UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

25 lines (21 loc) 494 B
'use strict'; var react = require('react'); function applyRef(ref, value) { if (value) { if (typeof ref === "function") { ref(value); } else if (ref && "current" in ref) { ref.current = value; } } } function mergeRefs(value, ...refs) { for (const ref of refs) { applyRef(ref, value); } } function useRefs(...refs) { return react.useCallback((value) => mergeRefs(value, ...refs), refs); } exports.useRefs = useRefs; //# sourceMappingURL=use-refs.cjs.map