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 337B

1234567891011121314151617
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = useUpdatedRef;
  4. var _react = require("react");
  5. /**
  6. * Returns a ref that is immediately updated with the new value
  7. *
  8. * @param value The Ref value
  9. */
  10. function useUpdatedRef(value) {
  11. var valueRef = (0, _react.useRef)(value);
  12. valueRef.current = value;
  13. return valueRef;
  14. }