You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes your whole app crashes, because of a single React component that threw: maybe render() tried to map an array that was undefined, or WillMount() tried to talk to a service that threw internally
...
there’s ultimately no reliable way to recover from a crashed component as a library or utility.
...
Simply put, you should never throw inside your React lifecycle methods. If this means a little bit of extra defensive programming, I think component resilience is a worthwhile cost. Don’t litter code with unnecessary invariant checks ...
We should look into a lint rule that can enforce this.
The text was updated successfully, but these errors were encountered:
some good advice from @crazytoucan (abridged):
We should look into a lint rule that can enforce this.
The text was updated successfully, but these errors were encountered: