You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe the second is more straightforward for the compiler, but if this restriction could be loosened, I think it would greatly improve the developer experience of working with the animate directive.
Alternatives considered
The only foreseeable workaround would be to continue using the filtered approach which sometimes requires redundant logic, like this:
Describe the problem
I get the usual
An element that uses the animate directive must be the immediate child of a keyed each block
error when attempting to do this:REPL: https://svelte.dev/repl/9a63f6ad0066480a93d31729ed959577?version=3.59.1
That doesn't work, but the same logic refactored into a filter of the each'd array does work:
REPL: https://svelte.dev/repl/b9a2dec8a0fc474b819e905a79b08b43?version=3.59.1
Describe the proposed solution
Maybe the second is more straightforward for the compiler, but if this restriction could be loosened, I think it would greatly improve the developer experience of working with the animate directive.
Alternatives considered
The only foreseeable workaround would be to continue using the filtered approach which sometimes requires redundant logic, like this:
REPL: https://svelte.dev/repl/9a63f6ad0066480a93d31729ed959577?version=3.59.1
when the desire was just to do this:
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: