Skip to content

Document $$props #2528

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

Closed
Rich-Harris opened this issue Apr 23, 2019 · 4 comments
Closed

Document $$props #2528

Rich-Harris opened this issue Apr 23, 2019 · 4 comments

Comments

@Rich-Harris
Copy link
Member

Looks like we missed this?

@Conduitry
Copy link
Member

It's sort of shoehorned into https://svelte.dev/tutorial/spread-props - which is probably as much as it needs to be mentioned in the tutorial - but yup needs somewhere more referency

@reinink
Copy link

reinink commented Apr 23, 2019

Yes, was going to recommend this! I found it by browsing around in the tutorial section.

@mindrones mindrones added docs and removed site labels Apr 27, 2019
@Conduitry
Copy link
Member

We only have one special magic global like this now, which does make deciding where to put this a bit tricky. A new number/bullet under <script>? And entirely new subsection under 'Component format'? If we do add more magic globals (like $$slots for example), would these all go in the same place and would that make it less awkward to have a new section somewhere?

@mindrones
Copy link
Member

mindrones commented May 8, 2019

To me this belongs to https://svelte.dev/docs#1_export_creates_a_component_prop.

I would append a paragraph similar to the phrase used in the tutorial, like:

The variable $$props can be used to reference all the props that were passed into a component, including the ones that weren't declared with export.

Eventually I'd also add the recommendation in a blockquote:

It's not generally recommended, as it's difficult for Svelte to optimise, but it's useful in rare cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants