const [loc, setLoc] = useState(default);
const handleChanges = (event, data, setLocFunction) => {
const storedLoc = [...data];
storedLoc[event.target.dataset.id][event.target.name] = event.target.value;
setLocFunction(storedLoc);
};
That's my setup then in my JSX I am trying to pass those value to my handleChange function like so:
<input
className="ddRowLat"
type="text"
onChange={handleLocChanges(event, loc, setLoc}
key={index}
value={item.lat}
data-id={index}
name="lat"
/>
but I'm encountering an eslint rule https://eslint.org/docs/rules/no-restricted-globals for the event. What's the correct solution to this issue?