meteor / react-packages

Meteor packages for a great React developer experience
http://guide.meteor.com/react.html
Other
574 stars 159 forks source link

Add componentDidCatch [wip] #240

Closed StorytellerCZ closed 7 years ago

StorytellerCZ commented 7 years ago

Not really sure how the final implementation should look like, but I would like to start the debate about including the new React 16 error handling.

This is super useful as if there is an error in withTracker then without componentDidCatch it can bring down the entire app (unless there are other). Adding componentDidCatch helps to localize the crash only to that given component and allow for recovery.

More can be done to handle and display the error, but I wanted to open this PR to get opinions on how this should be done.

The downside is that this will also catch any errors inside the component if there isn't specified componentDidCatch.