4 ms·
There is no harm in adding something to the dependency array that you don't expect to ever change. The linter is your friend; make its job easier.
by brlewis 6y ago
There is no harm in adding something to the dependency array that you don't expect to ever change. The linter is your friend; make its job easier.
- tekkk 6y agoWell, I disagree. As I said in my other reply - if the intention is that the prop is immutable there should be an error instead of very strange recomputation of the useEffect hook.