-
-
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
Svelte 5 :allow pass snippet to parent with export #10652
Comments
What's the use case here? What does this allow you to do that's easier than making Simple examples/reproductions are good, but this one might be a little too simple right now, as it's not yet clear why this would be helpful. |
better DX imo the main reason is we can allow parent component to place the snippet wherever he/she likes which means flexibility and child component can be self-contained with sharing states. without this, i have to create multiple components, and one global $state that share the state or pass rune around which can be not fun i.e have a dialog component, and i want to allow user to render the 'x' close button, with snippet, i can create it inside dialog and allow user to place where he pleases, even better since snippet have access to the open $state runes, parent component can just use this 'x' button to control the child ( might be a bad example but i hope u get it) |
Closing as duplicate of #10350 |
Describe the problem
since we allow $derived to be exported i think we can allow snippet to be export too
Describe the proposed solution
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: