@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
16 lines (15 loc) • 476 B
JavaScript
import { useForkRef } from './useForkRef.js';
import { isReactVersionAtLeast } from './reactVersion.js';
/**
* Merges the rendering element's `ref` in addition to the other `ref`s.
* @ignore - internal hook.
*/
export function useRenderPropForkRef(render, ...refs) {
let childRef;
if (typeof render !== 'function') {
childRef = isReactVersionAtLeast(19) ? render.props.ref : render.ref;
} else {
childRef = null;
}
return useForkRef(childRef, ...refs);
}