Skip to content

"was created with unknown prop" warning on when using $$props.* #2878

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
btakita opened this issue May 27, 2019 · 3 comments · Fixed by #2881
Closed

"was created with unknown prop" warning on when using $$props.* #2878

btakita opened this issue May 27, 2019 · 3 comments · Fixed by #2881

Comments

@btakita
Copy link
Contributor

btakita commented May 27, 2019

Using $$props.class causes the warning. Since class is a keyword, the suggested way to access class was to use $$props.class.

@btakita
Copy link
Contributor Author

btakita commented May 27, 2019

This issue seems related to #2840.

@btakita
Copy link
Contributor Author

btakita commented May 27, 2019

Also getting:

<Component> was created with unknown prop '$$slots'
<Component> was created with unknown prop '$$scope'

@Conduitry
Copy link
Member

This is still a valid bug, but the suggested way to have a prop called class is not to use $$props.class - see https://svelte.dev/docs#1_export_creates_a_component_prop

Rich-Harris added a commit that referenced this issue May 27, 2019
dont create unknown prop warnings for $$scope etc, or if component has $$props
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

Successfully merging a pull request may close this issue.

2 participants