implement-react-hooks icon indicating copy to clipboard operation
implement-react-hooks copied to clipboard

Calling callback in the useEffect itself is wrong

Open SalehDehqanpour opened this issue 1 year ago • 0 comments

https://github.com/rohitpotato/implement-react-hooks/blob/be021ac9dfafc84d91d62f280fcb979e703cc4f1/hooks.js#L54

According to react, the effect is run after the render and commit finishes but this code is calling cb in the body of useEffect itself.

SalehDehqanpour avatar Sep 22 '24 10:09 SalehDehqanpour