-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TwigComponent] Passing props from a parent component to a child with different HTML syntax #2514
Comments
Not a bug, but something we could document better. Self-closing component have better performance, isolation, and modern architecture.. embedding ones have more features and extension capacities :) |
Hi, this is caused by our if ($isSelfClosing) {
// use the simpler component() format, so that the system doesn't think
// this is an "embedded" component with blocks
// see https://github.com/symfony/ux/issues/810
$output .= "{{ component('{$componentName}'".($attributes ? ", { {$attributes} }" : '').') }}';
} else {
$output .= "{% component '{$componentName}'".($attributes ? " with { {$attributes} }" : '').' %}';
} When the component is not self-closing, then it is replaced by To me, that's definitely an issue, when using components like Vue or React, you do not expect variables to be secretly passed down to your component. |
This is a feature, it has been asked for and documented :) |
So... it is broken by design? What about I don't see where it has been asked / documented, can you give me some hints please? 🙏🏻 |
Hi,
I have a problem but I don't know if it's a bug or if it's an intended behavior :
I want to pass a props (for my example, the props is called
disabled
) from a parent component to the child component.Props are passed when it is a component with a self-closing HTML syntax. For my example:
<twig:Form:Label>Description</twig:Form:Label>
However, when it is a component with opening and closing tag HTML syntax, the props are not passed from the parent to the child. For my example
<twig:Form:Textarea />
Is this normal?
The text was updated successfully, but these errors were encountered: