in React we can create distinct components that encapsulate behavior which we need. After that , we can render only some of the components, depending on the state of our application.
Conditional rendering in React Use if or the conditional operator to create elements representing the current state, and let React update the UI to match them.
if we want a component to hide itself even though it was rendered by another component. return null instead of its render output.
Returning null from a component’s render method does not affect the firing of the component’s lifecycle methods. For instance componentDidUpdate will still be called.