3 ms·
Time to go on a tangent, does anyone think useEffect was good idea? In general I've found "side-effects" libraries like rxjs & saga's being the main cause of bu
by wouldbecouldbe 3y ago
Time to go on a tangent, does anyone think useEffect was good idea? In general I've found "side-effects" libraries like rxjs & saga's being the main cause of bugs in react codebases, and useEffect a good second.
- zeptonix 3y agoKinda necessary isn't it? What would you replace it with?
- Scarblac 3y agoIt's necessary but way overused. The docs have a whole page explaining how things some devs do with useEffect should be done differently: https://react.dev/learn/you-might-not-need-an-effect https://react.dev/learn/you-might-not-need-an-effect. I think class based components led to really strange patterns that people thought should all be replaced with useEffect in function components. UseEffect is sometimes necessary and then it's fine but it's a code smell too.