UNPKG

react-native-onyx

Version:

State management for React Native

17 lines (16 loc) 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("react"); /** * Creates a mutable reference to a value, useful when you need to * maintain a reference to a value that may change over time without triggering re-renders. * * @deprecated This hook breaks the Rules of React, and should not be used. * The migration effort to remove it safely is not currently planned. */ function useLiveRef(value) { const ref = (0, react_1.useRef)(value); ref.current = value; return ref; } exports.default = useLiveRef;