text: import { useConstant } from '../utils/use-constant.js';
  import { motionValue } from './index.js';
  
  /**
   * 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 `MotionValue`s externally and pass them into the animated component via the `style` prop.
   *
   * @library
   *
   * ```jsx
   * export function MyComponent() {
   *   const scale = useMotionValue(1)
   *
   *   return <Frame scale={scale} />
   * }
   * ```
   *
   * @motion
   *
   * ```jsx
   * export const MyComponent = () => {
   *   const scale = useMotionValue(1)
   *
   *   return <motion.div style={{ scale }} />
   * }
   * ```
   *
   * @param initial - The initial state.
   *
   * @public
   */
  function useMotionValue(initial) {
      return useConstant(function () { return motionValue(initial); });
  }
  
  export { useMotionValue };
  