import * as compat_module from '../../../preact/compat/dist/compat.module.mjs';
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.mjs';
import { useState as h } from '../../../preact/hooks/dist/hooks.module.mjs';

// packages/react/id/src/id.tsx
var useReactId = compat_module[" useId ".trim().toString()] || (() => void 0);
var count = 0;
function useId(deterministicId) {
  const [id, setId] = h(useReactId());
  useLayoutEffect2(() => {
    setId((reactId) => reactId ?? String(count++));
  }, [deterministicId]);
  return (id ? `radix-${id}` : "");
}

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