-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Trans crashes if one of its children is null #1307
Comments
Can you please provide a reproducible example? |
How do you run into a case where you pass null as child to Trans?!? Isn't that code under your control? |
<Trans i18nKey="description.part1">
To get started, edit <code>src/App.js</code> and save to reload. {null}
</Trans>
By taking normal React code and introducing Relevant types from react: type PropsWithChildren<P> = P & { children?: ReactNode };
type ReactNode = ReactChild | ReactFragment | ReactPortal | boolean | null | undefined;
type ReactFragment = {} | ReactNodeArray;
interface ReactNodeArray extends Array<ReactNode> {} which means |
should be fixed with v11.8.15 |
react-i18next/src/Trans.js
Lines 75 to 77 in 2bd69a2
typeof null
returns'object'
, so theTrans
component will attempt to extract a field calledformat
fromnull
, which crashes:version:
"react-i18next": "^11.8.13",
The text was updated successfully, but these errors were encountered: