How to have kind of 'named slot' in Solid like Vue?

I know there is 'props.children' But I want to place each children to different location inside component. What should I have to do?
3 Replies
lxsmnsyc
lxsmnsyc3y ago
<div>
{props.firstSlot}
<div>
{props.secondSlot}
</div>
</div>
<div>
{props.firstSlot}
<div>
{props.secondSlot}
</div>
</div>
<Foo firstSlot={<span />} secondSlot={<span />} />
<Foo firstSlot={<span />} secondSlot={<span />} />
musiclover
musicloverOP3y ago
Ok, I should add props. what's the type of slot in TS? 'JSXElement' ?
lxsmnsyc
lxsmnsyc3y ago
yes, JSX.Element to be specific
Want results from more Discord servers?
Add your server