title: Error boundaries should implement getDerivedStateFromError()
body: <p>I was working on a project and everything was working fine, suddenly my app crashed because of this error :</p>
  
  <pre><code>Warning: %s: Error boundaries should implement getDerivedStateFromError(). 
  In that method, return a state update to display an error message or fallback UI., RootErrorBoundary
  </code></pre>
  
  <p>The error is in these files :  </p>
  
  <pre><code>* src/config/routes.js:31:27 in &lt;unknown&gt;
  * src/modules/auth/actions.js:69:29 in &lt;unknown&gt;
  </code></pre>
  
  <p>in the line which contains _this.setState for routes.js :</p>
  
  <pre><code>componentDidMount() {
      let _this = this;
      store.dispatch(checkLoginStatus((isLoggedIn) =&gt; {
          _this.setState({isReady: true, isLoggedIn});
      }));
  }
  </code></pre>
  
  <p>and in the line which contains callback(isLoggedIn) for actions.js :</p>
  
  <pre><code>export function checkLoginStatus(callback) {
      return (dispatch) =&gt; {
          auth.onAuthStateChanged((user) =&gt; {
              let isLoggedIn = (user !== null);
  
              if (isLoggedIn) {
                  //get the user object from the Async storage
                  AsyncStorage.getItem('user', (err, user) =&gt; {
                      if (user === null) isLoggedIn = false //set the loggedIn value to false
                      else dispatch({type: t.LOGGED_IN, data: JSON.parse(user)})
  
                      callback(isLoggedIn);
                  });
              } else {
                  dispatch({type: t.LOGGED_OUT});
                  callback(isLoggedIn);
              }
          });
      };
  }
  </code></pre>
  
  <p>please help me resolve this problem.</p>