import * as React from 'react';
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.mjs';

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

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