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-lazy-ref
diceui-base/use-lazy-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-lazy-ref.jsonSource
1import * as React from "react";23function useLazyRef<T>(fn: () => T) {4 const ref = React.useRef<T | null>(null);56 if (ref.current === null) {7 ref.current = fn();8 }910 return ref as React.RefObject<T>;11}1213export { useLazyRef };
