I have the following React component:
class Parent extends Component {
constructor(props) {
super(props)
this.state = {
isRendered: false
}
}
render() {
return (
<div className="result">
Rendering result
</div>
)
}
}
Based on the state of this.state.isRendered
, I want my <div>
component to render if the state is true
, and not render if the state is false
.
What would be the best way to organize it in React?