Skip to content
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] Documents the spread syntax under the "Component Attribute" section #2457

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

eokic
Copy link

@eokic eokic commented Dec 20, 2024

Q A
Bug fix? no
New feature? no
Issues
License MIT

Motivated by #2455, adds a syntax reminder in a place where many readers might be looking for it.

Used an inline code sample to keep the note minimal and unobtrusive, but I can update it with a proper code block if needed.

@smnandre
Copy link
Member

If you can link to the html syntax block of the same doc it would be better, we dont want user of TwigComponent only to be confused if they read Live Component doc with our realizing it.

Also you’re right to suggest this and yes I would do a small block with a line or text to explain the need (array or dynamic Attributes) and a little block code showing how to pass and id and a disabled true/false atrribute like that.

Tell me if you need any help!

@smnandre smnandre added the docs Improvements or additions to documentation label Dec 21, 2024
Comment on lines +932 to +935
.. note::

Quick reminder that passing an array of attributes to the *Component* requires the spread operator syntax (``<twig:MyComponent {{ ...attributes }} />``). See `Component HTML Syntax`_.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm in fact this may be confusing. Using the attributes variable here may be missunderstood as we are talking about the component attributes just after.

What could be done here is a reminder link targetting Passing & Rendering Attributes in the first pargraph of Component Attributes

Copy link
Member

@smnandre smnandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(cf the comment about component attributes / passing attributes)

@carsonbot carsonbot added Status: Needs Work Additional work is needed and removed Status: Needs Review Needs to be reviewed labels Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation Status: Needs Work Additional work is needed TwigComponent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants