rmdort / react-redux-multilingual

A simple and slim multi-lingual component for React with Redux without react-intl or react-i18n
41 stars 14 forks source link

Form resets when language is changed. #11

Closed Vishal1419 closed 6 years ago

Vishal1419 commented 6 years ago

I have a simple login form which have 2 inputs. The placeholder for both of them is set through this library using withTranslate.

Everything works fine. But now when I type something inside any of the input, and then when I change the language, all the fields are emptied out.

I don't know why this thing is happening but I guess this is due to rerender. How can I overcome this problem?

Please Note: I am using redux-form

rmdort commented 6 years ago

Yes. Changing the language will re-render the entire app because of component key

https://github.com/rmdort/react-redux-multilingual/blob/master/src/provider.js#L40

You could remove it to prevent re-render