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.

15 lines (13 loc) 291 B
'use client'; import * as React from 'react'; import { useEnhancedEffect } from './useEnhancedEffect.js'; /** * @ignore - internal hook. */ export function useLatestRef(value) { const ref = React.useRef(value); useEnhancedEffect(() => { ref.current = value; }); return ref; }