this post was submitted on 17 Mar 2024
8 points (100.0% liked)
React
907 readers
1 users here now
A community for discussing anything related to the React UI framework and it's ecosystem.
Wormhole
Icon base by Skoll under CC BY 3.0 with modifications to add a gradient
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Sometimes you do want state variables in the dep array. Not super often but it does happen.
And you shouldn't just always use an empty array. That creates fragile components. Even for effects that you want to just run once. Always follow the eslint rule