BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/diceui/base/use-as-ref
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-ref
RemovedHook

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.json

Source

hooks/use-as-ref.tsraw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/base-vega/use-as-ref.json
1import * as React from "react";
2
3import { useIsomorphicLayoutEffect } from "@/registry/bases/base/hooks/use-isomorphic-layout-effect";
4
5function useAsRef<T>(props: T) {
6 const ref = React.useRef<T>(props);
7
8 useIsomorphicLayoutEffect(() => {
9 ref.current = props;
10 });
11
12 return ref;
13}
14
15export { useAsRef };

What it pulls in

Other registry items

  • @diceui/use-isomorphic-layout-effect

Files it writes

  • hooks/use-as-ref.ts

Facts

Registry
diceui/base
Type
registry:hook
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-09
Last confirmed
4 days ago

Go to the source

www.diceui.com sadmann7/diceui on GitHub Raw registry item This item as JSON
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex