this post was submitted on 26 Mar 2026
12 points (92.9% liked)
React
1324 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 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
When used properly like the websocket example it's clear what it does. If you're using useEffect to sync props and state, then yes, you're going to have trouble reasoning through it. The solution is to not use useEffect because you're no longer writing React, you're writing Angular. No named function expression will fix that.
The author actually addresses this point, explaining that since you name your effects, you should realise when they are used to sync states and take action.
As a side-note, eslint-plugin-react-you-might-not-need-an-effect might be better suited to catch these.