useMergedRefs — AutoGrowTextArea
- from @astryx
- by Astryx
An AutoGrowTextArea that forwards the caller's ref and also keeps its own ref to measure scrollHeight. The merged ref attaches both to the same textarea: it resizes itself while a parent button focuses it through the forwarded ref.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @astryx/example-use-merged-refs-auto-grow-text-areaRegistry dependencies0
The CLI adds no other registry items with this one.
