I am looking to render conditionally some HTML elements of my component.
I have a state variable Boolean, which can be either true (want to render text) or false (want to render nothing).
Inside the return param for the render functon, I have tried the following:
{this.state.boolean ? <div><h1>True</h1></div> : <div></div>}
{this.state.boolean && <div><h1>True</h1></div> || <div></div>}
But in both cases, the h1 element is rendered regardless of the state of Boolean!
Any ideas? Thanks in advance.