Standard value for driving animations. One Animated.Value can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, or calling setValue) will stop any previous ones.

Hierarchy (view full)

Constructors

Methods

  • Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to synchronously read the value because it might be driven natively.

    Parameters

    Returns string

  • Sets the offset value to the base value, and resets the base value to zero. The final output of the value is unchanged.

    Returns void

  • Merges the offset value into the base value and resets the offset to zero. The final output of the value is unchanged.

    Returns void

  • Stops any animation and resets the value to its original.

    See https://reactnative.dev/docs/animatedvalue#resetanimation

    Parameters

    • Optional callback: ((value) => void)
        • (value): void
        • Parameters

          • value: number

          Returns void

    Returns void

  • Sets an offset that is applied on top of whatever value is set, whether via setValue, an animation, or Animated.event. Useful for compensating things like the start of a pan gesture.

    Parameters

    • offset: number

    Returns void

  • Directly set the value. This will stop any animations running on the value and update all the bound properties.

    Parameters

    • value: number

    Returns void

  • Stops any running animation or tracking. callback is invoked with the final value after stopping the animation, which is useful for updating state to match the animation position with layout.

    Parameters

    • Optional callback: ((value) => void)
        • (value): void
        • Parameters

          • value: number

          Returns void

    Returns void