Skip to content

Commit 973f9f5

Browse files
committed
Adds the spread syntax sidenote to "Component Attribute" section
1 parent dec3eb3 commit 973f9f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/TwigComponent/doc/index.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ component's template:
929929
My Component!
930930
</div>
931931

932+
.. note::
933+
934+
Quick reminder that passing an array of attributes to the *Component* requires the spread operator syntax (``<twig:MyComponent {{ ...attributes }} />``). See `Component HTML Syntax`_.
935+
932936
When rendering the component, you can pass an array of html attributes to add:
933937

934938
.. code-block:: html+twig
@@ -1796,6 +1800,7 @@ https://symfony.com/doc/current/contributing/code/bc.html
17961800
.. _`Live Components`: https://symfony.com/bundles/ux-live-component/current/index.html
17971801
.. _`live component`: https://symfony.com/bundles/ux-live-component/current/index.html
17981802
.. _`Vue`: https://v3.vuejs.org/guide/computed.html
1803+
.. _`Component HTML Syntax`: https://symfony.com/bundles/ux-live-component/current/index.html#component-html-syntax
17991804
.. _`Live Nested Components`: https://symfony.com/bundles/ux-live-component/current/index.html#nested-components
18001805
.. _`Passing Blocks to Live Components`: https://symfony.com/bundles/ux-live-component/current/index.html#passing-blocks
18011806
.. _`Stimulus controller`: https://symfony.com/bundles/StimulusBundle/current/index.html

0 commit comments

Comments
 (0)