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

Same 'previous' and 'new' value of language property #1203

Closed
dgnusov opened this issue Nov 23, 2020 · 2 comments
Closed

Same 'previous' and 'new' value of language property #1203

dgnusov opened this issue Nov 23, 2020 · 2 comments

Comments

@dgnusov
Copy link

dgnusov commented Nov 23, 2020

🐛 Bug Report

Hi!

Faced an issue when using withTranslation HOC.

Previous value of language property of i18n object is exact same as new one when i'm trying to access it within ComponentDidUpdate method.

Is it a bug or i'm doing something wrong?

I've found a similar old issue: #508
But is seems like that solution is not actual for new versions.

To Reproduce

https://codesandbox.io/s/great-moore-04ob5

Expected behavior

Previous value and new value not same.

Your Environment

i18next 19.7.0
react 16.12.0
react-i18next 11.7.3

@jamuhl
Copy link
Member

jamuhl commented Nov 23, 2020

i18n is the prop -> that i18n instance did not change -> so accessing something like i18n.language will always show the current value

@dgnusov
Copy link
Author

dgnusov commented Nov 23, 2020

@jamuhl so i need to implement some logic to track that at my side.
Ok! I have no problem with that :) Just wanted to check if there any other more natural solution.

Thank you for reply!

@jamuhl jamuhl closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants