S
SolidJS13mo ago
Mirardes

Change Component Name

Actually I'm developing for a design system a component Title and I want to be able to have a props named tag to change the tag of the component (h1/h2/h3). When I try to do this I have "Comp is not a function" This is the code :
<props.tag>
{props.children}
</props.tag>
<props.tag>
{props.children}
</props.tag>
Can someone can help please ? Thanks !
1 Reply
Mirardes
MirardesOP13mo ago
Stack Overflow
Dynamic tag name in Solid JSX
I would like to set JSX tag names dynamically in SolidJS. I come from React where it is fairly simple to do: /* Working ReactJS Code: */ export default MyWrapper = ({ children, ..attributes }) =&gt...
Want results from more Discord servers?
Add your server