import '../../../preact/compat/dist/compat.module.mjs';
import { useRef as _, useEffect as p, useMemo as F } from '../../../preact/hooks/dist/hooks.module.mjs';

// packages/react/use-callback-ref/src/use-callback-ref.tsx
function useCallbackRef(callback) {
  const callbackRef = _(callback);
  p(() => {
    callbackRef.current = callback;
  });
  return F(() => (...args) => callbackRef.current?.(...args), []);
}

export { useCallbackRef };
//# sourceMappingURL=index.mjs.map
