MCPcopy Create free account
hub / github.com/react-component/select / useId

Function useId

src/hooks/useId.ts:25–32  ·  view source on GitHub ↗
(id?: string)

Source from the content-addressed store, hash-verified

23}
24
25export default function useId(id?: string) {
26 // Inner id for accessibility usage. Only work in client side
27 const [innerId, setInnerId] = React.useState<string>();
28 React.useEffect(() => {
29 setInnerId(`rc_select_${getUUID()}`);
30 }, []);
31 return id || innerId;
32}

Callers 1

Select.tsxFile · 0.85

Calls 1

getUUIDFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…