-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
I can't migrate my component to Svelte 5 #15125
Comments
I created a workaround. I create a prop called |
Sorry I've read this multiple times but I don't get what's the issue you are facing. What is happening? Why can't you just create a prop for each snippet? |
Maybe the problem is that you are using the slot property within the snippet? |
@paoloricciuti check the linked discussion. The problem is an interaction with custom elements where Svelte prohibits the use of |
Oh yeah that was my idea too...mmm this is a tricky one |
We are having trouble with sourcemaps and want to migrate to Svelte 5. This prevents us from making an easy transition. How do you think we can proceed? |
An easy workaround would be to use the snippet to only populate the internal of the element. So basically instead of <button slot="blabla">
{@render children()}
</button> But that might not be fully possible. |
If I make such a move, it means that I will use the action slots only for the button, which will create a big breaking change in our project. Additionally, each button has its own variants. Unfortunately, I cannot change the Dialog component in this way. |
`slot` is treated as a regular prop if it is not used directly inside another component, but we were running validations on such regular props that should only be run on real slots. Fixes #15125
Discussed in #15117
Originally posted by Enes5519 January 27, 2025
The svelte 4 component I will share below is the wrapper version of a custom element from a different library on the Svelte side. The code below was working perfectly with the use of slots, but now I cannot achieve the same perfection because the slot rules are very strict. At the first stage, I was going to update it only by upgrading the version, can you help me at this stage?
Normally I translated it as below, but do I need to create a separate prop for each component to pass the slot attribute? For example, I made the
bl-button
custom element a component and I cannot use them under each other.Problematic usage
The text was updated successfully, but these errors were encountered: