October 2026 - useValueAsRef and useRefWithInit
use-as-ref and use-lazy-ref are renamed to match Base UI, and Base UI components use Base UI's own hooks.
Dice UI components use two small ref hooks. They now share Base UI's names, so call sites read the same in both bases:
| Before | After | Base UI | Radix |
|---|---|---|---|
useAsRef | useValueAsRef | @base-ui/utils/useValueAsRef | @diceui/use-value-as-ref |
useLazyRef | useRefWithInit | @base-ui/utils/useRefWithInit | @diceui/use-ref-with-init |
Base UI components no longer copy either hook into your project. Radix components install the renamed hooks.
Migrating
Existing components keep working, because your copies of the old hooks stay in place. To move over, reinstall the components, or update the imports yourself:
import { useAsRef } from "@/hooks/use-as-ref";
import { useLazyRef } from "@/hooks/use-lazy-ref";
import { useRefWithInit } from "@base-ui/utils/useRefWithInit";
import { useValueAsRef } from "@base-ui/utils/useValueAsRef"; import { useAsRef } from "@/hooks/use-as-ref";
import { useLazyRef } from "@/hooks/use-lazy-ref";
import { useRefWithInit } from "@/hooks/use-ref-with-init";
import { useValueAsRef } from "@/hooks/use-value-as-ref"; Then rename the calls. @diceui/use-as-ref and @diceui/use-lazy-ref still install for now and will be removed in a future release.