UNPKG

react-stable-ref

Version:

An assortment of utilities for testing against unstable references in React

13 lines 432 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = require("react"); function useRenderCount(initialCount) { if (initialCount === void 0) { initialCount = 1; } var countRef = react_1.useRef(initialCount); react_1.useEffect(function () { countRef.current++; }); return countRef.current; } exports.default = useRenderCount; //# sourceMappingURL=useRenderCount.js.map