first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import * as React from 'react';
import { getId } from '@fluentui/utilities';
/**
* Hook to generate a unique ID in the global scope (spanning across duplicate copies of the same library).
*
* @param prefix - Optional prefix for the ID
* @param providedId - Optional id provided by a parent component. Defaults to the provided value if present,
* without conditioning the hook call
* @returns The ID
*/
export function useId(prefix, providedId) {
// getId should only be called once since it updates the global constant for the next ID value.
// (While an extra update isn't likely to cause problems in practice, it's better to avoid it.)
var ref = React.useRef(providedId);
if (!ref.current) {
ref.current = getId(prefix);
}
return ref.current;
}
//# sourceMappingURL=useId.js.map