title: React Native add text to TextInput on button click
body: <p>I would like to create a search field within React Native which works somehow similar to the searchfield on my webpage <a href="https://todayin.de/" rel="nofollow">https://todayin.de/</a> .</p>
  
  <p>What I did so far is the following:</p>
  
  <pre><code>class SearchField extends React.Component {
  constructor(props){
      super(props);
      this.state = {text: ''};
      this.U9 = '#U9';
  }
  render() {
      return(
          &lt;View&gt;
          &lt;TextInput 
          autoCorrect={false}
          autoFocus={false} 
          placeholder="#Kicker #Moabit"
          onChangeText={(text) =&gt; this.setState({text})}
          value={this.state.text}
          onSubmitEditing={(event) =&gt; this.startSearch()}
          /&gt;
  
          &lt;Button   
          style={{fontSize: 20, color: 'green'}}
          styleDisabled={{color: 'red'}}
          onPress={this.addTagToInput.bind(this)}
          &gt;
          {this.U9}
          &lt;/Button&gt;
  
          &lt;/View&gt;
  
          );
  }
  startSearch(){
      alert(this.state.text);
  }
  addTagToInput(event){
      this.state = {text: this.state.text + " " + this.U9};
  }
  
   }
  module.exports = SearchField;
  </code></pre>
  
  <p>When I enter a search text to the TextInput it works fine and is shown in alert() on submit. What I want to achieve now is, when I click on the button "#U9", I want to append the string #U9 to the text input and display it. Right now if I enter the text "test", click the "#U9" button and submit, I get "test #U9" alerted as I expect.
  The problem is, that the #U9 is not displayed in the input field. How can I update the text input when I click the button?</p>
  
  <p>For the finetuning I would like to add buttons and according values in a foreach to avoid repeating 10 times the same code. If any1 has a suggestion for that as well I would love to hear it!</p>
  
  <p>For the very very finetuning I would like to do the following:
  On first button click: append #U9 to the text.
  On second button click: remove #U9 from the text.</p>
  
  <p>Thanks a lot for some help!</p>
  
  <p>Cheers,
  Oliver</p>