import { useRef } from 'react';
/**
 * Works like `useRef` but accepts an initializer function that runs once on the first render, like
 * `useState`.
 */
export function useRefWithInit(initFn) {
    const ref = useRef(undefined);
    if (ref.current === undefined) {
        ref.current = initFn();
    }
    return ref;
}
//# sourceMappingURL=useRefWithInit.js.map