UNPKG

rsuite

Version:

A suite of react components

15 lines (14 loc) 319 B
'use client'; import { useRef } from 'react'; /** * Returns a ref that is immediately updated with the new value * * @param value The Ref value * @category refs */ export function useUpdatedRef(value) { var valueRef = useRef(value); valueRef.current = value; return valueRef; } export default useUpdatedRef;