I want to add type in code but I don't know about what type can I use
const handleFileChange = (e: any>) => {
setCollect({
...collect,
[e.target.name]: e.target.files[0],
});
};
I won't use any, how can I fix it
I want to add type in code but I don't know about what type can I use
const handleFileChange = (e: any>) => {
setCollect({
...collect,
[e.target.name]: e.target.files[0],
});
};
I won't use any, how can I fix it
Proper typing for this event is the following:
React.ChangeEvent<HTMLInputElement>
It will let you access e.target.files.