I am using Atomic design to structure my React components.
A certain ui child component (an atom) should be shown or not based on a value (prop).
Is it a better practice to add the conditional rendering inside this child component like:
const Child = ({ show }: Props) => {
return show ? (
<span>Foo</span>;
) : null
}
or add the conditional rendering part inside the parent component:
{ show && <Child /> }
What is a better practice: Add conditional rendering logic inside React child ui component or inside parent component?