I am new to React native. I have a noob question related to moving code away from the main function which is render() and put the code into a different function.
Let's say I have the following code:-
render() {
return (
<View>
<Modal
animationType={"fade"}
transparent={true}
visible={this.state.signUpPopUpVisible}
onRequestClose={() => {alert("Modal has been closed.")}}>
{/* Other modal codes */}
</Modal>
<View style={styles.mainView}>
{/* Other mainView codes */}
</View>
</View>
);
}
How can I move the whole code
<Modal
animationType={"fade"}
transparent={true}
visible={this.state.signUpPopUpVisible}
onRequestClose={() => {alert("Modal has been closed.")}}>
{/* Other modal codes */}
</Modal>
into a different function and call it in the render()?
Thanks.