How to pass classes to custom component

Hi, lets say I have this example component
function Content(props) {
return <div class={`timeline-content ${props.classes}`}>
{props.children}
</div>
}
function Content(props) {
return <div class={`timeline-content ${props.classes}`}>
{props.children}
</div>
}
I want to create use the component like so
<Content class="some-class" />
//instead of
<Content classes="some-class" />
<Content class="some-class" />
//instead of
<Content classes="some-class" />
is that possible?
2 Replies
thetarnav
thetarnav2y ago
class should just work use props.class in the component Also the clsx package is useful for this kind of class-combining
KokoNeot
KokoNeotOP2y ago
I'll give it a try thanks
Want results from more Discord servers?
Add your server