Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Suspense is also a crazy anti-pattern by literally throwing and catching errors as a means for communicating between parts of the framework.

Okay I can criticize React and its weird solutions until the cows come home, but this is a pretty weird one because it’s entirely an implementation detail. No one working with Suspense ever needs to know that’s how it works unless they’re building a library to be compatible with its behavior. Otherwise it’s just trivia.



Wouldn't the debugger break on exception? So any exceptions used in "nonexceptional" situations have a potential to "pollute" the debugging experience?

Admittedly, I haven't tried debugging React 18 yet, so I don't know if that actually happens in practice.


Only if you set it to break on handled exceptions/Promise rejections. This isn’t new behavior in React 18, it’s been the mechanism used for Suspense since it was introduced. If you have used Suspense and haven’t had unexpected debugger pauses, that’s what you should expect going forward.




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

Search: