UNPKG

ivt

Version:

Ivt Components Library

19 lines (16 loc) 529 B
import * as React from 'react'; import { u as useLayoutEffect2 } from './index-DKOlG3mh.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 (id ? `radix-${id}` : ""); } export { useId as u }; //# sourceMappingURL=index-tkRL9Tft.mjs.map