Jesus sucks
This commit is contained in:
23
backend/frontend/node_modules/@restart/hooks/cjs/useCommittedRef.js
generated
vendored
Normal file
23
backend/frontend/node_modules/@restart/hooks/cjs/useCommittedRef.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
var _react = require("react");
|
||||
/**
|
||||
* Creates a `Ref` whose value is updated in an effect, ensuring the most recent
|
||||
* value is the one rendered with. Generally only required for Concurrent mode usage
|
||||
* where previous work in `render()` may be discarded before being used.
|
||||
*
|
||||
* This is safe to access in an event handler.
|
||||
*
|
||||
* @param value The `Ref` value
|
||||
*/
|
||||
function useCommittedRef(value) {
|
||||
const ref = (0, _react.useRef)(value);
|
||||
(0, _react.useEffect)(() => {
|
||||
ref.current = value;
|
||||
}, [value]);
|
||||
return ref;
|
||||
}
|
||||
var _default = useCommittedRef;
|
||||
exports.default = _default;
|
||||
Reference in New Issue
Block a user