UNPKG

@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.

10 lines 278 B
/** * If the provided argument is a ref object, returns its `current` value. * Otherwise, returns the argument itself. */ export function resolveRef(maybeRef) { if (maybeRef == null) { return maybeRef; } return 'current' in maybeRef ? maybeRef.current : maybeRef; }