-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the problem
Hi !
After discussion on the discord, the question remains. Why isn't it possible to use @const inside #key ?
When @const is the first child of a #key, the compile gives us the "const_tag_invalid_placement". Which list every other # keywords, so why not #key ?
This is not a big deal. there are multiple workaround for that.
<svelte:boundary>for inside loops when a parameter is necessary$derivedbut have to create an unused var
Small playground for reproduction and workarounds.
I don't know if this is just a missing feature/bug or if there are more implications that I am not aware of.
First time issue here, feel free to correct me I missed something, or close the issue if it's an intended behaviour.
I am not familiar enough to create a PR for this (As I don't know if editing the Visitor ConstTag is enough).
Describe the proposed solution
Allow @const inside #key as it make sense to create a template variable inside a reactive scope.
Importance
nice to have