I previously was on v4 and had my Select and MenuItems setup like so:
const [select, setSelect] = useState('');
const [customName, setCustomName] = useState('');
const handleChange = (event) => {
setSelect(event.target.value);
setCustomName(event.currentTarget.getAttribute('name'));
};
...
<Select
label="Choose A Dataset"
onChange={handleChange}
value={select}
>
{tables &&
tables.map(
(table, index) =>
(
<MenuItem
key={table.name}
value={table.code}
name={table.name}
>
{table.name}
</MenuItem>
)
)}
</Select>
and I could access the menuItem's name attribute through
event.currentTarget.getAttribute('name');
However, after the migration to v5, event.currentTarget returns null. Any suggestions?