@carbon/react
Version:
React components for the Carbon Design System
22 lines (21 loc) • 749 B
TypeScript
/**
* Generate a unique ID for React <=17 with an optional prefix prepended to it.
* This is an internal utility, not intended for public usage.
* @param {string} [prefix]
* @returns {string}
*/
export function useCompatibleId(prefix?: string): string;
/**
* Generate a unique id if a given `id` is not provided
* This is an internal utility, not intended for public usage.
* @param {string|undefined} id
* @returns {string}
*/
export function useFallbackId(id: string | undefined): string;
/**
* Generate a unique ID for React >=18 with an optional prefix prepended to it.
* This is an internal utility, not intended for public usage.
* @param {string} [prefix]
* @returns {string}
*/
export function useId(prefix?: string): string;