Issue
lets say I have a small useEffect hook -
useEffect(()=>
if(!someVariable) return;
doSomething(someVariable);
),[someVariable]);
what happens when I return without any cleanup function or anything else? is it wrong? gonna create bugs?
I've tried to search the docs but there's nothing about it, and technically it works great, but I wanna be sure
Solution
there's an answer in JS docs about it that has nothing to do with react.js -
so it turns out that either way any function in JS return at least undefined value (implicitly) so me doing so in a useEffect has no effect (pun intended)
Answered By - Tzachi Elrom
Answer Checked By - - Jay B. (ReactFix Admin)