Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
scotty79
2y ago
0 comments
Save
Share
You can just trigger fetch in the function that does the state change.
0 comments
1 comments · 1 top-level
top
newest
oldest
shortcake27
2y ago
Agreed, this is the correct approach. Overusing effects makes control flow difficult to understand and has many unintended consequences. The misuse of effects is so widespread the React team had to address it with Strict mode in React 18.
j
/
k
navigate · click thread line to collapse