Skip to content

Commit fbeef03

Browse files
authored
fix: replace usages of React.useId with useUniqId (#2472)
1 parent e50d710 commit fbeef03

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/Accordion/AccordionSummary/AccordionSummary.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import * as React from 'react';
44

55
import {KeyCode} from '../../../constants';
6+
import {useUniqId} from '../../../hooks';
67
import {Disclosure} from '../../Disclosure';
78
import type {DisclosureSummaryRenderFunctionProps} from '../../Disclosure/DisclosureSummary/DisclosureSummary';
89
import type {QAProps} from '../../types';
@@ -24,7 +25,7 @@ export function AccordionSummary(props: AccordionSummaryProps) {
2425
const {registerSummary, unregisterSummary, getSummaryRefs, arrowPosition, size, ariaLevel} =
2526
useAccordion();
2627

27-
const summaryId = React.useId();
28+
const summaryId = useUniqId();
2829
const [buttonElement, setButtonElement] = React.useState<HTMLButtonElement | null>(null);
2930

3031
React.useEffect(() => {

src/components/PinInput/__stories__/PinInput.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {action} from 'storybook/actions';
55

66
import {Showcase} from '../../../demo/Showcase';
77
import {ShowcaseItem} from '../../../demo/ShowcaseItem';
8+
import {useUniqId} from '../../../hooks';
89
import {Flex} from '../../layout';
910
import type {PinInputApi, PinInputProps} from '../PinInput';
1011
import {PinInput} from '../PinInput';
@@ -140,7 +141,7 @@ export const Responsive: Story = {
140141
export const WithLabel = {
141142
render: function WithLabel(args) {
142143
const id = args.id ?? 'pin-input';
143-
const labelId = React.useId();
144+
const labelId = useUniqId();
144145
const refApi = React.useRef<PinInputApi>(null);
145146
/* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions */
146147
return (

0 commit comments

Comments
 (0)