Just return null instead of the rendered output to hide a component.
You can hide the component even when it’s being rendered using another component.
Something like this:
...
if (!props.content) {
return null;
}
...
Render the element like the way you usually do:
...
...
Here’s the working example:
This is really useful with conditional rendering.
examples render toggle visibility