RefMerger

Primitive #65

๐Ÿ” Problem it solves

A component needs its own internal reference to an element while also exposing it to the parent. Merging multiple refs is not built into plain JavaScript/React.

โœ… Solution

mergeRefs(...refs) returns a callback that forwards the element to all provided refs โ€“ object refs and callback refs alike. This demo uses the libraryโ€™s mergeRefs.

๐Ÿงฉ Used by components

All components that need to expose element references (Button, Input, Dialog, etc.)

๐ŸŽฎ Interactive demo