ReactNativeLocalization icon indicating copy to clipboard operation
ReactNativeLocalization copied to clipboard

How to use this package along with Redux and Mobx ?

Open BhavanPatel opened this issue 5 years ago • 4 comments

Doc or Example needed.

BhavanPatel avatar Jun 25 '19 12:06 BhavanPatel

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

stefalda avatar Jun 25 '19 12:06 stefalda

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

stuartaylward avatar Aug 23 '19 13:08 stuartaylward

@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

bhavantrt avatar Aug 28 '19 04:08 bhavantrt

@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

TimAbraldes avatar Oct 17 '19 21:10 TimAbraldes