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.
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 withoutcomponentDidCatch
it can bring down the entire app (unless there are other). AddingcomponentDidCatch
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
.