Answer the question
In order to leave comments, you need to log in
How to render the CircleTopik component only in the middle Card component?
function Card() {
return (
<div className={s.mainBlock}>
<CircleTopik />
</div>
)
}
function App() {
return (
<div className={s.app}>
<Card />
<Card />
<Card />
</div>
)
}
Answer the question
In order to leave comments, you need to log in
function Card(props) {
return (
<div>
{props.children}
</div>
);
}
function App() {
return (
<div>
<Card />
<Card>
<CircleTopik />
</Card>
<Card />
</div>
);
}
function Card({ showCircle }) {
return (
<div>
{showCircle ? <CircleTopik /> : null}
</div>
);
}
function App() {
return (
<div>
<Card />
<Card showCircle={true} />
<Card />
</div>
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question