0
I’m using the version 16.12.0
React. I own a functional Component called Card
and would like to insert html into it (I would like to not change its source code).
Card:
function Card ({cardHeader, cardBody, cardDescription}){
return (
<>
<div className="card">
<div className="card-header">
<h1>{cardHeader}</h1>
<p>{cardDescription}</p>
</div>
<div className="card-body">
{cardBody}
</div>
</div>
</>
)}
And I would like to move the html further into this component as follows:
<Card cardHeader={cardTitle} cardBody={object} >
<div className="card-close">
...
</div>
</Card>
That way, other places that use the card’s Component won’t need adaptations. Any ideas ?