diff --git a/src/hooks/useTagGroup/utils/useElementIds.ts b/src/hooks/useTagGroup/utils/useElementIds.ts index 5c46fccb..773f11b6 100644 --- a/src/hooks/useTagGroup/utils/useElementIds.ts +++ b/src/hooks/useTagGroup/utils/useElementIds.ts @@ -13,8 +13,9 @@ type UseElementIdsReturnValue = { getTagId: (index: number) => string } -// eslint-disable-next-line @typescript-eslint/dot-notation -const reactUseId = React['useId'] +// https://github.com/downshift-js/downshift/issues/1674#issuecomment-3924320872 +const SafeReact = {...React} +const reactUseId = SafeReact.useId // istanbul ignore next export const useElementIds: ( diff --git a/src/hooks/utils.dropdown/useElementIds.ts b/src/hooks/utils.dropdown/useElementIds.ts index d9268803..e38f7fbc 100644 --- a/src/hooks/utils.dropdown/useElementIds.ts +++ b/src/hooks/utils.dropdown/useElementIds.ts @@ -19,8 +19,9 @@ type UseElementIdsReturnValue = { inputId: string } -// eslint-disable-next-line @typescript-eslint/dot-notation -const reactUseId = React['useId'] +// https://github.com/downshift-js/downshift/issues/1674#issuecomment-3924320872 +const SafeReact = {...React} +const reactUseId = SafeReact.useId export const useElementIds = typeof reactUseId === 'function' ? useElementIdsR18 : useElementIdsLegacy