1//you define a function to generate the view
2viewGenerator(isTrue){
3 if(isTrue){
4 return( //you return the view you want to generate
5 <View>
6 <Text>Generated text</Text>
7 </View>
8 );
9 }
10}
11
12render(){
13 return(
14 <View>
15 //then you use it inside your view like this
16 {this.viewGenerator(true)}
17 </View>
18 );
19}