# useForkRef
> Merges multiple refs into a single callback ref.

Merges multiple React refs (callback refs, ref objects, or null) into a single callback ref. Useful when a component needs to forward its ref while also keeping an internal reference.

## Import

```js
import { useForkRef } from '@volue/wave-react';
```

## Example

```jsx
const Component = React.forwardRef((props, forwardedRef) => {
  const internalRef = React.useRef(null);
  const composedRef = useForkRef(forwardedRef, internalRef);

  return <div ref={composedRef} {...props} />;
});
```

---

## API reference

### Arguments

| Name      | Type                              | Default | Description                                                                       | Required |
| --------- | --------------------------------- | ------- | --------------------------------------------------------------------------------- | -------- |
| `...refs` | `(Ref<T> \| undefined \| null)[]` | `—`     | Variable number of refs (callback refs, ref objects, or null/undefined) to merge. |          |

### Returns

`(instance: T | null) => void` — A callback ref that forwards the instance to all provided refs.
