title: How to show selected value from modal on text component in react-native
body: <h2>How to set selected value from modal on text component in react-native.</h2>
  
  <p>I am using modal component from 'react-native'.</p>
  
  <p>import { StyleSheet, View, Text, TouchableOpacity, Image,Modal,} from 'react-native'</p>
  
  <pre><code>        &lt;View style={styles.vwstyle}&gt;
              &lt;Text style={styles.texthead}&gt;You are Interested in&lt;/Text&gt;
  
              &lt;View style={styles.vwside}&gt;
                  &lt;Modal
                      animationType="fade"
                      transparent={false}
                      visible={this.state.modalVisible}
  
                      onRequestClose={() =&gt; {
                      }}&gt;
                      &lt;View style={styles.vwmodal}&gt;
  
                          &lt;TouchableOpacity style={styles.touchmodal}
                              onPress={() =&gt; {
                                  this.setModalVisible(!this.state.modalVisible);
                              }}&gt;
                              &lt;Text style={styles.txtmodal}&gt;Man&lt;/Text&gt;
                          &lt;/TouchableOpacity&gt;
                          &lt;TouchableOpacity style={styles.touchmodal}
                              onPress={() =&gt; {
                                  this.setModalVisible(!this.state.modalVisible);
                              }}&gt;
                              &lt;Text style={styles.txtmodal}&gt;Woman&lt;/Text&gt;
                          &lt;/TouchableOpacity&gt;
                          &lt;TouchableOpacity style={styles.touchmodal}
                              onPress={() =&gt; {
                                  this.setModalVisible(!this.state.modalVisible);
                              }}&gt;
                              &lt;Text style={styles.txtmodal}&gt;Everyone&lt;/Text&gt;
                          &lt;/TouchableOpacity&gt;
  
                      &lt;/View&gt;
                  &lt;/Modal&gt;
  
                      &lt;TouchableOpacity 
                      style={{flexDirection:'row'}}
                       onPress={() =&gt; {this.setModalVisible(true);}}&gt;
                           &lt;Text style={styles.txtselected}&gt;Woman&lt;/Text&gt;
                          &lt;Image
                              source={require('../Images/rightarrow.png')} style={{ height: 20, width: 20, marginTop: 8, marginRight: 5 }} /&gt;
                          &lt;/TouchableOpacity&gt;
              &lt;/View&gt;
          &lt;/View&gt;
  </code></pre>