return 3ctext 3e using if condition react native

Solutions on MaxInterview for return 3ctext 3e using if condition react native by the best coders in the world

showing results for - "return 3ctext 3e using if condition react native"
Rayan
28 Mar 2016
1constructor() {
2   super();
3
4   this.state ={
5     status:true
6   }
7}
8
9render() {
10   return( 
11
12     { this.state.status === true ?
13           <TouchableHighlight onPress={()=>this.hideView()}>
14             <View style={styles.optionView}>
15               <Text>Ok Fine :)</Text>
16             </View>
17          </TouchableHighlight>
18           :
19           <Text>Ok Fine.</Text>
20     }
21  );
22}
23
24hideView(){
25  this.setState({
26    home:!this.state.status
27  });
28}
29