diff --git a/index.d.ts b/index.d.ts index fffb6fbd2..5b8b778ca 100644 --- a/index.d.ts +++ b/index.d.ts @@ -42,14 +42,6 @@ declare module 'i18next' { } } -declare global { - namespace JSX { - interface IntrinsicAttributes { - i18nIsDynamicList?: boolean; - } - } -} - type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true ? Record : never; @@ -57,6 +49,12 @@ type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true type ReactI18NextChildren = React.ReactNode | ObjectOrNever; declare module 'react' { + namespace JSX { + interface IntrinsicAttributes { + i18nIsDynamicList?: boolean; + } + } + interface HTMLAttributes { // This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop // expects a single child of type 'ReactI18NextChildren', but multiple children were provided": @@ -144,7 +142,7 @@ export function withTranslation< }, ): < C extends React.ComponentType & WithTranslationProps>, - ResolvedProps = JSX.LibraryManagedAttributes< + ResolvedProps = React.JSX.LibraryManagedAttributes< C, $Subtract, WithTranslationProps> >,