Im using create-react-app to make my aplication. After I save the files to compile the terminal throws the folowing error: src\App.js Line 37:21: 'setOpenModal' is assigned a value but never used no-unused-vars
src\App\App.js Line 37:21: 'setOpenModal' is assigned a value but never used no-unused-vars
the thing is, the file App.js I moved to a file called App and changed the name to index.js. Also I sent the variable setOpenModal to a element like so:
src/App/index.js:
const [openModal, setOpenModal] = React.useState(false);
return (
<AppIU
doc_type={doc_type}
date={date}
course={course}
openModal={openModal}
setOpenModal={setOpenModal}
/>
);
the function setOpenModal is actually being used in another file and I pass the fuction through props. is there a way to make react realice that the variable is being used and that the file src/App.js no longer exists??
I've tried just saving again the file to compile it again expecting the warnig to just go away but it persists. Ive also tryed adding the /* eslint-disable no-unused-vars / and / eslint-enable no-unused-vars */ before and after declerign the const but it still does not remove the warning. Also I would like to not jus disable the warnings as I have a tendency to forget about decleared variables :v