-
-
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
Fix non-list dynamic content in Trans component #1660
Conversation
What is the use case of having You give the sample: <Trans>
Hi there,{' '}
<React.Fragment i18nIsDynamicList>
{someDynamicVar}
</React.Fragment>
</Trans> which has nothing todo with the usage of that flag is only used for creating the string for saveMissing feature and only for the case where content is like: https://react.i18next.com/latest/trans-component#using-with-lists-v10.5.0 |
In our project we're using key fallback for all translations, so the key for It seems extracting JSX expressions is broken in
We have a couple different pieces of code that are similar to the above in our project, where we want to display the list differently depending on whether it has 1 element, or multiple. We could split it into a ternary with two Trans elements, but this reduces duplicate code. |
@nicegamer7 shouldn't that warning be gone? |
btw: included in v13.1.0 |
@adrai I wasn't able to remove the warning from React.Fragment, since it has its own validation that happens before rendering occurs. But the warning is removed for all HTML elements. |
Hi! This PR closes #1658.
Changes
Checklist
yarn test