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

unwanted init of redux-i18n when page refreshes #91

Open
sorokinvj opened this issue Sep 24, 2018 · 1 comment
Open

unwanted init of redux-i18n when page refreshes #91

sorokinvj opened this issue Sep 24, 2018 · 1 comment

Comments

@sorokinvj
Copy link

Hey guys,

So consider this case – user switched language, then refresh page and bam! everything is goes to initialized values. How to avoid that?

What is the logic behind action REDUX_i18N_SET_LANGUAGE ???
It fires on every component no matter what – how to turn it off? Or force it to fire just once?

@DimitrisD
Copy link
Contributor

You can persist some state information to the local storage or to the session storage, depending on what you want to do exactly.

You can either use middleware or you can use your own code.

Very fast example: https://stackoverflow.com/questions/37195590/how-can-i-persist-redux-state-tree-on-refresh

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