> I would say useEffect is not an escape hatch, it's a fundamental building block of the hooks paradigm
The react docs literally call it an escape hatch [0]. First sentence.
[0]https://beta.reactjs.org/learn/you-might-not-need-an-effect
The react docs literally call it an escape hatch [0]. First sentence.
[0]https://beta.reactjs.org/learn/you-might-not-need-an-effect
useEffect let’s you safely communicate with the world outside react (ie cause side effects). It’s the only reliable way to …escape.
The original docs made no such claim.
Which brings us back to the biggest problem with useEffect. Even the react devs don’t seem to have a clue how it should actually used, until only recently, despite it being among the 2 most used hooks ever since hooks were introduced.
The original docs are outdated
The abstraction itself is ripe for misuse
Tons of devs use it when they shouldn’t.
Insert shrug emoji here.