title: How can I get SetState to stop overwriting my component tags
body: <p>I am using these tags in my react native app: <a href="https://github.com/peterp/react-native-tags" rel="nofollow noreferrer">https://github.com/peterp/react-native-tags</a>
  Being a react rookie I have a problem with SetState. I have set-up the tags like this:</p>
  
  <pre><code>&lt;Tags
        initialText=""
        textInputProps={{
             placeholder: "Servicable Postcodes"
        }}
        initialTags={["3121"]}
        onChangeTags={(tags) =&gt; this.changeTags(tags)}
        inputStyle={{ backgroundColor: "white", borderBottomWidth: 1 }}
        renderTag={({ tag, index, onPress, deleteTagOnPress, readonly }) =&gt; (
             &lt;TouchableOpacity key={${tag}-${index}} onPress={onPress}&gt;
                  &lt;Text style={styles.tagStyle}&gt;{tag}&lt;/Text&gt;
             &lt;/TouchableOpacity&gt;
        )}
   /&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code> changeTags(newtags) {
        //this.setState({ myTags: newtags.toString()});
        var tagList = newtags.toString();
        /*this.setState({myTags: tagList}, function () {
             console.log(this.state.myTags);
        });*/
    }
  </code></pre>
  
  <p>Adding tags works like this [3121] [1111] [2222]</p>
  
  <p>So that code works well. As soon as I uncomment the setState it will run everything like normal but the tag will not get added to the list. So if I add 1111 my console log will  be <code>3121, 1111</code> (But 1111 will not show as as a tag) then if i try to add another it will be <code>3121, 2222</code> etc.</p>
  
  <p>I think because it re-renders with setState the tag is never added/overwritten and I just keep getting left with the single 3121 tag. Or maybe i'm a react noob and have no idea.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks</p>