This component no longer exists. It was in diceui/base’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-13 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
use-as-ref
diceui-base/use-as-refRemovedHook
diceui/base publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/base-vega/use-as-ref.jsonSource
1import * as React from "react";23import { useIsomorphicLayoutEffect } from "@/registry/bases/base/hooks/use-isomorphic-layout-effect";45function useAsRef<T>(props: T) {6 const ref = React.useRef<T>(props);78 useIsomorphicLayoutEffect(() => {9 ref.current = props;10 });1112 return ref;13}1415export { useAsRef };
What it pulls in
Other registry items
