stefalda / ReactNativeLocalization

Class to localize the ReactNative interface
MIT License
899 stars 124 forks source link

How to use this package along with Redux and Mobx ? #163

Open BhavanPatel opened 5 years ago

BhavanPatel commented 5 years ago

Doc or Example needed.

stefalda commented 5 years ago

Hi, unfortunately I don't use them, but maybe someone else can help you...

stuartaylward commented 5 years ago

@BhavanPatel - what is it you are trying to achieve?

bhavantrt commented 5 years ago

@stuartaylward I am trying to achieve like , On change of language I do not want to restart the whole application but I just want to do normal language switcher... but I am not able to achieve that by changing the language it wont change strings of screens that are already mounted. So I was thinking to do using redux/mobx but I am missing that doc or example. Help me if you can? Thanks

TimAbraldes commented 4 years ago

@BhavanPatel @bhavantrt You'll need to have your Component re-render whenever the language changes. For Redux, you'll probably want to store the selected language in your state store. Assuming you're using react-redux you'll then modify the mapStateToProps function for any Component that needs to re-render when the language changes. See react-redux documentation on mapStateToProps affecting Component re-renders