Skip to content

Allow directives (actions/transitions/animations) to be more dynamic #6942

Open
@dummdidumm

Description

@dummdidumm

Describe the problem

Svelte encourages reactivity at many levels, but when it comes to actions, transitions, or animations, it's rather static:

  • you are not allowed to swap out one directive for another at runtime. Doesn't work for actions, does work for transitions/animations only when they are not rendered
  • you can't conditionally apply a directive by setting it to undefined; it will throw a runtime error
  • attributes are not always updated, related to Transitions: dynamic attributes #3633

Describe the proposed solution

Support swapping out directives

Alternatives considered

Workaround code involving #ifs

Importance

nice to have

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions