Hacker News new | past | comments | ask | show | jobs | submit login

I understand why it’s worded that way in this specific article. But it’s still unfortunate to call it an escape hatch.

This term is typically used for ways of breaking the rules of a framework. With useEffect you’re still very much in React world and need to follow the rules to achieve much of anything with it.

The norm would be not to use an escape hatch. But I doubt there are many React applications that aren’t using useEffect.




In useEffect your code runs at a specific point, where it’s safe to bridge react to the outside world. It’s not about breaking the rules, as much as you have the ability to cause and react to side effects (eg a fetch promise) and inform react about the result (with a setState).


That’s much better explanation and more precise wording than the linked article did. I like the notion of “safe bridge”.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: