title: Set random backgroundColor from array
body: <p>I spent around 2 hours on that and I really need help. I want to get random color from my array and then set backgroundColor of  to that one color. I copied my code there. <a href="https://jsfiddle.net/1x0k2ot4/" rel="nofollow noreferrer">https://jsfiddle.net/1x0k2ot4/</a>  </p>
  
  <p>Thank you for every advice.</p>
  
  <pre><code>constructor(props) {
      super(props);
      const ds = new ListView.DataSource({rowHasChanged: (r1, r2) =&gt; r1 !== r2});
      this.state = {
          inputValue: '',
          backgroundColor: '',
          dataSource: ds.cloneWithRows([]),
      };
      this._handleTextChange = this._handleTextChange.bind(this);
      this._handleDeleteButtonPress = this._handleDeleteButtonPress.bind(this);
      this._setColor = this._setColor.bind(this);
  }
  
  _setColor() {
      const backgroundColor = backgroundcolors[Math.floor(Math.random()*backgroundcolors.length)];
      this.setState({
          backgroundColor: backgroundColor
      })
  }&lt;View style={{ backgroundColor: this.state.backgroundColor, alignItems: 'center', height: 80, padding: 8, borderWidth: 1.5, borderColor: '#e0e0e0', flex: 1, flexDirection: 'row', marginBottom: 5,}}&gt;
                                  &lt;Text style={styles.todoText}&gt;{rowData}&lt;/Text&gt;
                                  &lt;View&gt;
                                      &lt;TouchableHighlight onPress={handleDelete} style={styles.crossCloseButton}&gt;
                                          &lt;View&gt;
                                              &lt;Image style={styles.imgClose} source={{uri: 'http://playground.davidfutera.cz/close.png'}}/&gt;
                                          &lt;/View&gt;
                                      &lt;/TouchableHighlight&gt;
                                  &lt;/View&gt;
                              &lt;/View&gt;
  </code></pre>