IssueRaiser

This is a footgun I found at a few Amazon internal apps recently.

This is a footgun I found at a few Amazon internal apps recently. I was able to clear away probably 3/4 uses of useEffect--some of which I was guilty of adding. Given how common this error is, there is definitely an unmet need. What people want is a listener, ie.: - recalculate a var whenever a prop changes (this is what useMemo is for) - trigger a function when a state changes (should be moved to the function that changed the state)

Posted by Gunax on Mar 23, 2023, 9:18 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

hackernews (Other)

This is a footgun I found at a few Amazon internal apps recently.

GunaxMar 23, 2023, 9:18 AM

This is a footgun I found at a few Amazon internal apps recently. I was able to clear away probably 3/4 uses of useEffect--some of which I was guilty of adding. Given how common this error is, there is definitely an unmet need. What people want is a listener, ie.: - recalculate a var whenever a prop changes (this is what useMemo is for) - trigger a function when a state changes (should be moved to the function that changed the state)

Comments (0)

No comments yet. Start the discussion.

Comment on this issue