CleeveCleeve
Back
Open
Why you shouldn't put refs in a dependency array

Why you shouldn't put refs in a dependency array

If you use a ref in your effect callback, shouldn't it be included in the dependencies? Why refs are a special exception to the rule!