import * as React from "react"; function useRefWithInit(init: () => T): React.RefObject { const [ref] = React.useState(() => ({ current: init() })); return ref; } export { useRefWithInit };