The useCurrentValue hook allows associating a value with current based on its parameter, equivalent to:
useCurrentValue
current
const ref = useRef(); ref.current = value;
With the useCurrentValue hook
useCurrentValue(value)
Last updated 1 year ago
Was this helpful?