UNPKG

250 BJavaScriptView Raw
1import * as React from 'react';
2export default function useLazyRef(callback) {
3 const lazyRef = React.useRef();
4
5 if (lazyRef.current === undefined) {
6 lazyRef.current = callback();
7 }
8
9 return lazyRef;
10}
11//# sourceMappingURL=useLazyRef.js.map
\No newline at end of file