I have a Component with an onClick event. This event sets in my global state some boolean to true. How can, depending on this boolean render/hide another component?
I could write something like (pseudocode!)
<ParentCompononet
conditionalRendering(props) {
if(props.boolean) {
<ConditionalComponent />
} else {
null
}
render () {
return (
{ conditionalRendering }
)
/>
Not sure if that would be the right way
connectthe state variable to thepropsof the component?