"use strict"; const React = require("react"); module.exports = function useLazyRef(initializer) { let ref = React.useRef({ initialized: false, value: undefined }); if (ref.current.initialized === false) { ref.current.value = { // We mirror the standard useRef structure here current: initializer() }; ref.current.initializer = true; } return ref.current.value; };