Skip to content

Commit

Permalink
allow iterable with objects as children
Browse files Browse the repository at this point in the history
typescript will now allow core react HTML tags to accept multiple nodes
mixed with translation objects as children
  • Loading branch information
gshokanov committed Jul 7, 2022
1 parent 2759ed2 commit 4e045a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ts4.1/index.d.ts
Expand Up @@ -102,9 +102,12 @@ declare module 'i18next' {
type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
? Record<string, unknown>
: never;

type ReactI18NextChild = React.ReactNode | ObjectOrNever;

declare module 'react' {
interface HTMLAttributes<T> {
children?: ReactNode | ObjectOrNever;
children?: ReactI18NextChild | Iterable<ReactI18NextChild>;
}
}

Expand Down

0 comments on commit 4e045a0

Please sign in to comment.