The logical &&
operator is also used to conditionally render the elements in React.
condition && true elements
The element is rendered only when the condition is true.
function Test() {
const show = true;
return <>{show && <h1>This is show component</h1>}</>;
}