Twig Component with Stimulus Attributes #2915
Replies: 4 comments
-
|
Beta Was this translation helpful? Give feedback.
-
@TomoyaHamasaki here you can use the <twig:Component {{ ...stimulus_controller('example') }} /> :) |
Beta Was this translation helpful? Give feedback.
-
I love you, but why does that work? lol what is |
Beta Was this translation helpful? Give feedback.
-
It's a spread operator (destructuring) borrowed from JavaScript |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How does one use stimulus when using a component?
<twig:Component {{ stimulus_controller('example') }} />
I can't do this as I can with a typical element. Is the only way to achieve this goal is by doing this?
<twig:Component data-controller="example" />
Beta Was this translation helpful? Give feedback.
All reactions