react-i18next
react-i18next copied to clipboard
warning when pass a number to Trans values prop
🐛 Bug Report
When we pass a number to values of Trans and use it as a child, we get a warning in the console.
To Reproduce
<Trans
i18nKey="update"
values={{
refreshInterval: 12,
}}
>
<span>{value}</span>
</Trans>
warning: react-i18next:: Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}
Expected behavior
I do not have any warning in the console.
Your Environment
- runtime version: i.e. node v18
- i18next version: i.e. 23.5.1
- os: Mac, Windows, Linux
I don't know what you mean... and you also did not provide a reproducible example.
We have to check type of number in here https://github.com/i18next/react-i18next/blob/1ff5cabcebcc833af8410dc4c69ea08070dda745/src/TransWithoutContext.js#L49
feel free to open a pull requests with tests
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.