Skip to content

WhenState doesn't stop looping animations #25

@evelant

Description

@evelant
        WhenState(
            isMovingState,
            { styleKey: "transform.rotate", outputRange: ["0deg", "-8deg", "0deg", "8deg", "0deg"] },
            { loop: Infinity }
        ),

That config will loop forever even when isMovingState transitions to false.

To stop the animation I had to use OnExitState to stop the loop.

        WhenState(
            isMovingState,
            { styleKey: "transform.rotate", outputRange: ["0deg", "-8deg", "0deg", "8deg", "0deg"] },
            { loop: Infinity }
        ),
        OnExitState(
            isMovingState,
            { styleKey: "transform.rotate", outputRange: ["1deg", "0deg"] },
            { loop: 1 }
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions