title: React Native - Common place to do Access Token validation
body: <p>I have a react native app in which I am using Stack navigator. Within the screens I do a few Rest API calls to fetch data. </p>
  
  <p>The Rest API are having Token authentication, which I already saved using AsyncStorage, Access token is valid only for 10 hrs if there is any user action after 10 hrs the user needs to be logged of and redirected to login screen.</p>
  
  <p>I make API calls from ComponentDidMount() , so I have an idea of how to redirect the user to login is token is expired for ex:- </p>
  
  <pre><code>   ComponentDidMount()
      {
          var accessToken = await GetAccessToken();
          debugger;
          if (accessToken === null) {
            this.props.navigation.navigate("Auth");
          }
      }
  </code></pre>
  
  <p>But If were to do this kind of check at whole app level, how Can I do it without repeating this piece of code everywhere?</p>