UNPKG

1.06 kBTypeScriptView Raw
1/**
2 * @reach/auto-id v0.18.0
3 *
4 * Copyright (c) 2018-2022, React Training LLC
5 *
6 * This source code is licensed under the MIT license found in the
7 * LICENSE.md file in the root directory of this source tree.
8 *
9 * @license MIT
10 */
11
12/**
13 * useId
14 *
15 * Autogenerate IDs to facilitate WAI-ARIA and server rendering.
16 *
17 * Note: The returned ID will initially be `null` and will update after a
18 * component mounts. Users may need to supply their own ID if they need
19 * consistent values for SSR.
20 *
21 * @see Docs https://reach.tech/auto-id
22 */
23declare function useId(idFromProps: string): string;
24declare function useId(idFromProps: number): number;
25declare function useId(idFromProps: string | number): string | number;
26declare function useId(idFromProps: string | undefined | null): string | undefined;
27declare function useId(idFromProps: number | undefined | null): number | undefined;
28declare function useId(idFromProps: string | number | undefined | null): string | number | undefined;
29declare function useId(): string | undefined;
30
31export { useId };