Somehow I overlooked this new React 19 feature until now: Problem: I want to...


Somehow I overlooked this new React 19 feature until now:

Problem: I want to run some code when *any* caught or uncaught error occurs in my React app.

Solution: Declare onCaughtError and onUncaughtError on createRoot like this:

View original on X