Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

useUpdatedRef.js 265B

123456789101112
  1. import { useRef } from 'react';
  2. /**
  3. * Returns a ref that is immediately updated with the new value
  4. *
  5. * @param value The Ref value
  6. */
  7. export default function useUpdatedRef(value) {
  8. var valueRef = useRef(value);
  9. valueRef.current = value;
  10. return valueRef;
  11. }