Say you are passing a prop called show to a component. If the prop value is true, you should render the full component normally. If it is false, you should not display anything.
You can do this two ways.
- return null in the render method of the component.
- apply a CSS class containing
display: noneattribute to the component's DOM element.
Which ones is the correct or the preferred way?