• Creates a MotionValue to track the state and velocity of a value.

    Usually, these are created automatically. For advanced use-cases, like use with useTransform, you can create MotionValues externally and pass them into the animated component via the style prop.

    export const MyComponent = () => {
    const scale = useMotionValue(1)

    return <motion.div style={{ scale }} />
    }

    Type Parameters

    • T

    Parameters

    • initial: T

      The initial state.

    Returns MotionValue<T>

Generated using TypeDoc