title: How to stored a variable in asyncstorage?
body: <p>I currently learning react-native.</p>
  
  <p>I am trying to stored a variable into asyncstrorage in scriptone.js and calling it in scripttwo.js</p>
  
  <p>But i failed to stored the variable in scriptone.js</p>
  
  <p>What i have import in scriptone.js:</p>
  
  <pre><code>import React, { Component, BackAndroid } from "react";
  import { AsyncStorage } from 'AsyncStorage';
  import { View, Text, StyleSheet, Button, Image, TouchableOpacity, TextInput, Alert} from "react-native";
  </code></pre>
  
  <p>This is part of my code in scriptone.js</p>
  
  <pre><code>class SettingScreen extends Component {
    state = {
        a: '70',
        b: '',
        c: '',
      }; 
  
  onPressButton = () =&gt; {
        if (this.state.a == this.state.aa) {     
          this.setState({ b: this.state.a });
          this.storeData();
        }
         else {
          Alert("Try Again");
        }
      }
  
     storeData(){
          const {a} = this.state;
          let  mynum : a;
          AsyncStorage.setItem('array',mynum)
          Alert("Saved");
     }
  
  ...
  </code></pre>
  
  <p>The error display :</p>
  
  <pre><code>"undefined is not an object(evaluating '_AsyncStorage.AsyncStorage.setItem')
  </code></pre>
  
  <p>May I know what the problem?
  Thank you.</p>