title: Add object to an array and refresh the sectionList
body: <p>I added a new object of contact and trying to show it in SectionList.  But when I trying to put an object to array I'm getting an error: TypeError: undefined is not an object (evaluating 'n.data.length')</p>
  
  <p>I used the instructions in this link to solve the problem.
  <a href="https://stackoverflow.com/questions/46558721/how-to-add-a-new-object-as-a-value-to-an-array-in-the-react-state">how to add a new object as a value to an array in the react state</a></p>
  
  <pre><code>constructor(props) {
      super(props);   
  
      this.state = {
        contacts : [],
        newContactDialogVisible: false,
        contactName : '',
        contactPhone : ''
      }
    }
  </code></pre>
  
  <pre><code>refreshContactsList = () =&gt; {
      const newContact = {'name': this.state.contactName, 'phone': this.state.contactPhone};
      Alert.alert(newContact.name + " " + newContact.phone); // Alert working and shows the right data
      this.setState({ contacts: [...this.state.contacts, newContact] });
    }
  </code></pre>
  
  <pre><code>&lt;SectionList
              sections={this.state.contacts}
              renderItem={({item, index, section}) =&gt; &lt;Text key={index}&gt;{item}&lt;/Text&gt;}
            /&gt;
  </code></pre>