-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix wrong "slot" property warning (runtime) #6065
Conversation
Could anyone review this? Tell me if something wrong. This is my first pull request :) |
You are trying to use https://svelte.dev/repl/d6cc1555cae24c7b97185062e50363d4?version=3.35.0 AFAIK slot needs HTML inside them. |
@peopledrivemecrazy But in your REPL you are using slot as a regular prop. In REPL that I've provided I am using feature released in svelte some weeks ago. <A>
<span slot="slotname">
<B />
</span>
</A> And now I am trying to use slotted components #1037 like this: (but I get warning) <A>
<B slot="slotname" />
</A> Where slot property is used directly how it supposed to be used. |
I have updated my REPL with real usecase & naming and not just "A" and "B" |
@peopledrivemecrazy #4556 introduced To support this new shorthand pattern while avoiding the warning you'd need to export a (probably unused) So +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tanhauhau this looks good to me. Could you take one more look and merge if it looks good to you, too?
Released in 3.39.0 - thank you! |
Repl with error: https://svelte.dev/repl/421c409d2bca424b97d18791f4af4c08?version=3.35.0
When you use slot property on component you get wrong warning.
Before submitting the PR, please make sure you do the following
Tests
npm test
and lint the project withnpm run lint