I am using the following code to try and set the initial state by accessing the props value. I thought I could do it by accessing the (props) value but It seems to be empty.
constructor(props) {
super(props);
//this.renderRowForMain = this.renderRowForMain.bind(this);
this.state = {
show: props.showModal,
};
}
if I simply place the following insider the render() then it seems to be loading fine.
this.state = {
show: this.props.showModal,
};
What I am trying to do is initially set the showModal state to true and then when a close button is tapped change the state to false.