svelte
svelte copied to clipboard
docs: clarify let: directives
This tries to clarify the explanation of let:
directives through 3 changes:
- use a name other than
prop
for the specific prop in the example. Using the generic nameprop
might make a reader wonder if this is a keyword or magic name choice that needs to be used - add some comments to the example
- re-phrases the explanation to avoid the reader having to think about which direction is backwards
I found the statement "Slots can be rendered zero or more times and can pass values back to the parent" initially unclear because there are two dfferent child-parent relationships to consider (a component definition with a child <slot>
, and a use of the component with a child slot template).
I think these changes are helpful because this syntax is inherently somewhat confusing: as noted in https://github.com/sveltejs/svelte/pull/4125, let:foo={bar}
defines bar
to be a new variable set to the value of foo
, which is counter-intuitive.
@jamesscottbrown is attempting to deploy a commit to the Svelte Team on Vercel.
A member of the Team first needs to authorize it.
Hi! Could you resolve merge conflicts? The file structure has changed, so you may wanna move these changes to documentation/docs/02-template-syntax/07-special-elements.md
😁
Hi @jamesscottbrown. Are you still interested in pursuing this PR? If so, the merge conflicts will need to be addressed