title: React Native AsyncStorage calls have no effect, doesn't enter callback or .then
body: <p>A question about AsyncStorage. I'm working on a RN app and I need Async storage to keep track of the login state and token for the user. </p>
  
  <p>The behavior I see with AsyncStorage is really inconsistent. With the below code, I should see a console log of the state of the 'loggedIn' variable. Some runs I do see this, some runs I don't. I'm not sure why? I call this in componentwillmount() for my root component. So I don't think there's any behavior interfering beforehand. </p>
  
  <pre><code>AsyncStorage.getItem('loggedIn').then((loggedIn) =&gt; {
        console.log('loggedIn:');
        console.log(loggedIn);
        if ( loggedIn != null)
        {
          this.state.loggedIn = true;
        }
      });
  </code></pre>
  
  <p>This code at one point used to log like it's expected to, printing 'loggedIn: null', but it stopped printing at one point. Even though I didn't change the code. It seems like it doesn't even enter the .then block. </p>
  
  <p>I've also tried using a callback instead of promises and it still doesn't print the result. 
  I don't know what the problem is. Any ideas?</p>
  
  <p>I've downloaded Reactotron  to try and track AsyncStorage's behavior. But it doesn't seem to show any change to AsyncStorage when I try setting a variable in another one of my components, as shown in the code block below. </p>
  
  <p>On successful login I try and save the key, but it also doesn't seem to work. I don't get a console log, and I don't see any changes on Reactotron.</p>
  
  <pre><code>AsyncStorage.setItem('key', data.key, () =&gt; { AsyncStorage.getItem('key', (err, result) =&gt; {
                  console.log(result)});});
  </code></pre>
  
  <p>Not sure what other code snippets I need to illustrate the behavior. </p>