mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-29 03:45:15 +00:00
18 lines
355 B
JavaScript
18 lines
355 B
JavaScript
"use strict";
|
|
|
|
exports.__esModule = true;
|
|
exports.default = useUpdatedRef;
|
|
|
|
var _react = require("react");
|
|
|
|
/**
|
|
* Returns a ref that is immediately updated with the new value
|
|
*
|
|
* @param value The Ref value
|
|
* @category refs
|
|
*/
|
|
function useUpdatedRef(value) {
|
|
var valueRef = (0, _react.useRef)(value);
|
|
valueRef.current = value;
|
|
return valueRef;
|
|
} |