react-unique-id-generator
Version:
A lightweight, zero-dependency library for generating unique, sequential IDs in React — with hooks, custom prefix/suffix, SSR support, and stable CSS selector generation
17 lines • 624 B
TypeScript
import { type ReactNode } from 'react';
export interface IdContextValue {
nextId: (localPrefix?: string | null) => string;
prefix: string;
suffix: string;
}
export interface IdProviderProps {
prefix?: string;
suffix?: string;
startId?: number;
children: ReactNode;
}
declare const IdContext: import("react").Context<IdContextValue | null>;
export declare function IdProvider({ prefix, suffix, startId, children, }: IdProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useIdContext(): IdContextValue | null;
export { IdContext };
//# sourceMappingURL=context.d.ts.map