symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
824 stars 298 forks source link

[TwigComponent] Passing components as Props #1942

Closed seb-jean closed 3 months ago

seb-jean commented 3 months ago

Hello,

I would like to know if it is possible to pass Components as Props. Example with Headless UI:

<MenuButton as={MyCustomButton}>My account</MenuButton>

smnandre commented 3 months ago

Nope as you call MenuButton, so this is the component name/class.

I guess for children you could pass component name and call it with the twig function ?

seb-jean commented 3 months ago

Yes, that's what I was telling myself to pass component name and call it with the twig function.

smnandre commented 3 months ago

Can i close ? :)

seb-jean commented 3 months ago

It's linked to https://github.com/symfony/ux/issues/1922 so :)