Skip to content
Dice UI

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:

BeforeAfterBase UIRadix
useAsRefuseValueAsRef@base-ui/utils/useValueAsRef@diceui/use-value-as-ref
useLazyRefuseRefWithInit@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:

Base UI
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"; 
Radix
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.

On this page