SSE Hooks

useForkRef

Merges refs into a single memoized callback ref or null.

Installation

npx sse-tool add use-fork-ref

Usage

import { useForkRef } from "./{hooks file}";

const rootRef = React.useRef<Instance>(null);
const refFork = useForkRef(rootRef, props.ref);

return <Root {...props} ref={refFork} />;

API

Parameters

| Name | Type | Description | | :--- | :--- | :----------- | -------------- | | refs | Ref | undefined[] | The ref array. |

Return Value

Returns Function | any.

The new ref callback.

Changelog

81e9f — feat: update documentation and categorize hooks

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

2bd46 — feat: add useBattery and useClickAway hooks with supporting utilities

Built with Love • © 2026