Compare text in react-native
<p>How can you compare two text objects in React Native. </p>

<p>Sorry if the question is too triv. but after an hour of probing all possibilities I can't find the correct one. </p>

<pre><code>constructor(props) {
super(props)
this.state = { text: ''}
}

render() {
 return (
  &lt;View style={styles.container}&gt;
    &lt;TextInput
      style={styles.inputText}
      onChangeText={this.onChangeDo(this)}
    /&gt;
  &lt;/View&gt;
 );
}

  onChangeDo(event){
  (text) =&gt; this.setState( {text} )
  if(text equals 'string'){
  ...
 }
 else{
 ...
}
</code></pre>