-
-
Notifications
You must be signed in to change notification settings - Fork 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
Array access not supported in the use
or transition
directives
#11467
Comments
use
directive use
directive
use
directive use
or transition
directive
use
or transition
directive use
or transition
directives
This isn't a bug, exactly, it's just a limitation of the syntax. Ultimately we don't want to invest more in actions (we have ideas for a better set of primitives) beyond matching what works in Svelte 4, so I'm going to close this — the recommended solution is to use the |
Ok makes sense. Just out of curiosity what would be the better primitives replacing actions? |
Too soon to say exactly what they'd look like, but essentially we need a) better programmatic control over element lifecycle (to enable better coordination between different elements, to control when elements can be removed from the DOM, etc) and a syntax that doesn't force you to jump through hoops. It'll be a focus of a future release, post-5.0 |
Sounds great. Hopefully this could be a spreadable syntax unlike |
Yep, making this stuff spreadable is very much part of the plan |
Describe the bug
This syntax
gets compiled down to
so the array access doesn't work.
But all the other variations do work so it's a bit confusing / seems like a bug.
Same thing for transitions
Reproduction
https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE5WS3W6DMAyFX8XLJg2kQu9bQNsz7LLpRUrdNRokKDarKsS7TwFCW3XazwWI-Dg-n206cdAVklhtOmFUjWIlXptGLASfG3-gT6wYxUKQbV3pIxmVTjdcSCNZ1411DN1B7bGHg7M1yOnKkp0ypFlbI8XaJ_unrBQRvDWoPtBBN4RZlT4LcohiyIsQlVxaQ7bCtLLvkRRHLUU8Sr0048fFA3LwEIPRJI9er0RY76ozhLo0mhPk8ESsGKPNNl5PnsO7dKgYA6THyosbKAaaRYOn0E8UhwqS-agpDVZp09Ixmk5xSHHIrTOh1KWzmX9wUoF_tArtRCNyUNMb5kHMlpdFmewhSWBvkcwzw8m6D5AmSQppukdU5XF2mZFBUSBbgB6wsl3LbA20hKu7_I3eptMetfleviyrCOPrdJ8tx7KeZelZ-sDrMelfhN3LNLPwQ_2AeXPh5j_6Bf5-FnPbf-9wmP20lv_3ee0-SVfDD5G_00CSFGIharvXB417sWLXYr_tvwCr6_BOHQQAAA==
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: