Solid Primitives Refs

# @solid-primitives/refs [![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/refs?style=for-the-badge&label=size)](https://bundlephobia.com/package/@solid-primitives/refs) [![version](https://img.shields.io/npm/v/@solid-primitives/refs?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/refs) [![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-2.json)](https://github.com/solidjs-community/solid-primitives#contribution-process) Collection of primitives, components and directives that help managing references to JSX elements, keeping track of mounted/unmounted elements. ##### Primitives: - [`mergeRefs`](#mergerefs) - Utility for chaining multiple `ref` assignments with `props.ref` forwarding. - [`resolveElements`](#resolveelements) - Utility for resolving recursively nested JSX children to a single element or an array of elements. - [`resolveFirst`](#resolvefirst) - Utility for resolving recursively nested JSX children in search of the first element that matches a predicate. - [``](#refs) - Get up-to-date references of the multiple children elements. - [``](#ref) - Get up-to-date reference to a single child element. ## Installation ```bash npm install @solid-primitives/refs # or pnpm add @solid-primitives/refs # or yarn add @solid-primitives/refs ``` ## `mergeRefs` Utility for chaining multiple `ref` assignments with `props.ref` forwarding. ### How to use it ```tsx import { mergeRefs, Ref } from "@solid-primitives/refs"; interface ButtonProps { ref?: Ref; } function Button(props: ButtonProps) { let ref: HTMLButtonElement | undefined; onMount(() => { // use the local ref }); return