Skip to content
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

warning when pass a number to Trans values prop #1676

Open
mdeljavan opened this issue Sep 11, 2023 · 4 comments
Open

warning when pass a number to Trans values prop #1676

mdeljavan opened this issue Sep 11, 2023 · 4 comments
Labels

Comments

@mdeljavan
Copy link

mdeljavan commented Sep 11, 2023

🐛 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
@mdeljavan mdeljavan changed the title warning error when pass a number to warning error when pass a number to Trans values prop Sep 11, 2023
@adrai
Copy link
Member

adrai commented Sep 11, 2023

I don't know what you mean...
and you also did not provide a reproducible example.

@mdeljavan
Copy link
Author

@mdeljavan mdeljavan changed the title warning error when pass a number to Trans values prop warning when pass a number to Trans values prop Sep 11, 2023
@adrai
Copy link
Member

adrai commented Sep 11, 2023

feel free to open a pull requests with tests

@stale
Copy link

stale bot commented Oct 15, 2023

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.

@stale stale bot added the stale label Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants