How do I export components as child objects in a JavaScript object?
Hi Comunnity,
i have a quick question: How can I export a component, using
Dialog
as the root, for example, Dialog.Content
?
I have already tried to export with:
However, SolidJS doesn't quite want to do that, as it occasionally fails to render the child component 🤷♂️
Is there an alternative, with Typescript support?
Greetings Tobi ✌️3 Replies
I already know that you can export a component like this:
but this is a bit impractical for the button, because I have to write
Button.Root
every time:
Object.assign
should work fine, not sure why it's failing to render, that aside typescript allows you to directly assign properties to functions and will type it accordingly i.e.
Oops, my mistake, I applied
Object.assign
twice to the same function, so the sub component was overwritten 🤦♂️ Thanks for your answer anyway @otonashi9