From 4e045a098ae40c4c919df9df42ffc5da69a1fa32 Mon Sep 17 00:00:00 2001 From: George Shokanov Date: Tue, 5 Jul 2022 16:05:32 +0200 Subject: [PATCH] allow iterable with objects as children typescript will now allow core react HTML tags to accept multiple nodes mixed with translation objects as children --- ts4.1/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts4.1/index.d.ts b/ts4.1/index.d.ts index 29530ef4..24e442d6 100644 --- a/ts4.1/index.d.ts +++ b/ts4.1/index.d.ts @@ -102,9 +102,12 @@ declare module 'i18next' { type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true ? Record : never; + +type ReactI18NextChild = React.ReactNode | ObjectOrNever; + declare module 'react' { interface HTMLAttributes { - children?: ReactNode | ObjectOrNever; + children?: ReactI18NextChild | Iterable; } }