react native create view dynamically code example
Example: react native create view dynamically
//you define a function to generate the view
viewGenerator(isTrue){
if(isTrue){
return( //you return the view you want to generate
<View>
<Text>Generated text</Text>
</View>
);
}
}
render(){
return(
<View>
//then you use it inside your view like this
{this.viewGenerator(true)}
</View>
);
}