News for hackers. Stuff that matters.
Re:Common mistakes writing React components with hooks by brlewis on Tuesday July 21, 2020 @12:54PM (#23908485)
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.
Re:Common mistakes writing React components with hooks by tekkk on Tuesday July 21, 2020 @05:50PM (#23911355)
Well, 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.