New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix react merged types #1606
Fix react merged types #1606
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,11 +39,12 @@ declare module 'i18next' { | |
type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true | ||
? Record<string, unknown> | ||
: never; | ||
type ReactI18NextChild = React.ReactNode | ObjectOrNever; | ||
|
||
type ReactI18NextChildren = React.ReactNode | ObjectOrNever; | ||
|
||
declare module 'react' { | ||
interface HTMLAttributes<T> { | ||
children?: ReactI18NextChild | Iterable<ReactI18NextChild>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember why and when we did that, but it doesn't make much sense, since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. originally introduced with #1531 by @gshokanov to address #1506 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
children?: ReactI18NextChildren; | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, children will behave exactly like the actual one unless
allowObjectInHTMLChildren
istrue
.