title: AsyncStorage React Native save an Array
body: <p>I tried saving an array, I tried to follow the documentation but failed miserably. How should I write it so that it doesn't give me various warnings and errors.</p>
  
  <p><strong>Errors :</strong></p>
  
  <ul>
  <li>got an [Object Object] when I try to set the item</li>
  <li>Got an object instead of an array</li>
  <li>Attempted to assign to read only property</li>
  <li>expected a string, got an array</li>
  </ul>
  
  <p>Here is the code : <code>App.js</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> import React from "react";
   import {
    StyleSheet,
    Text,
    View,
    TextInput,
    ScrollView,
    TouchableOpacity,
    KeyboardAvoidingView,
    AsyncStorage
  } from "react-native";
  import Note from "./app/components/note";
  
  export default class App extends React.Component {
   state = {
      noteArray: [],
      noteText: ""
  };
  
  render() {
      let notes = this.state.noteArray.map((val, key) =&gt; {
          return (
              &lt;Note
                  key={key}
                  keyval={key}
                  val={val}
                  deleteMethod={() =&gt; this.deleteNote(key)}
              /&gt;
          );
      });
  
      return (
          &lt;KeyboardAvoidingView behavior="padding" style={styles.container}&gt;
              &lt;View style={styles.header}&gt;
                  &lt;Text style={styles.headerText}&gt;Tasker&lt;/Text&gt;
              &lt;/View&gt;
  
              &lt;ScrollView style={styles.scrollContainer}&gt;{notes}&lt;/ScrollView&gt;
  
              &lt;View style={styles.footer}&gt;
                  &lt;TouchableOpacity
                      onPress={this.addNote.bind(this)}
                      style={styles.addButton}
                  &gt;
                      &lt;Text style={styles.addButtonText}&gt;+&lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
  
                  &lt;TextInput
                      style={styles.textInput}
                      placeholder="Enter Task..."
                      placeholderTextColor="white"
                      underlinedColorAndroid="transparent"
                      onChangeText={noteText =&gt; this.setState({ noteText })}
                      value={this.state.noteText}
                  /&gt;
              &lt;/View&gt;
          &lt;/KeyboardAvoidingView&gt;
      );
  }
  
  addNote() {
      if (this.state.noteText) {
          var d = new Date();
          this.state.noteArray.push({
              date:
                  d.getFullYear() +
                  "/" +
                  (d.getMonth() + 1) +
                  "/" +
                  d.getDate(),
              note: this.state.noteText
          });
          this.setState({ noteArray: this.state.noteArray });
          this.setState({ noteText: "" });
      }
  
      //AsyncStorage.setItem() How do I write it so no errors occur
      alert({ noteArray: this.state.noteArray });
  }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Extra Note : The Error is on Expo App on my phone both Android and iOS</p>
  
  <p>Thanks in Advance!</p>