I get warnings in my WebStorm IDE that tell me that I'm not resolving promises in useEffect. I can make that warning go away but simply using a then
but I'm not sure I've added anything of value.
Would the code below where I've added a then
that does nothing be considered a good thing to do or a waste of time?
useEffect(() => {
async function getData() {
await new Promise((resolve) => setTimeout(resolve, 1000));
try {
//throw "crash"
setNotesData(notes);
} catch (e) {
setNotesDataError(e);
}
}
getData().then(() => {});
}, []);
JetBrains Warning Message: Promise returned from getData is ignored