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

Let me know how to integrate with react-intl #15

Open
justinFather opened this issue Feb 25, 2017 · 1 comment
Open

Let me know how to integrate with react-intl #15

justinFather opened this issue Feb 25, 2017 · 1 comment

Comments

@justinFather
Copy link

justinFather commented Feb 25, 2017

What I tried as below

class App_ extends Component {
	render() {
                return (
	                <Router store={store}>
	                        <Scene key="root">
                                ...
	                        </Scene>
	                </Router>
	        )		
	}
}

@inject( 'store' ) @observer
class ForIntlProvider extends Component {
	render() {
		return (
			<IntlProvider locale={store.locale} messages={all[store.locale]}>
				<App_/>
			</IntlProvider>
		)
	}
}

export default class App extends Component {
	render() {
		return (
			<Provider store={store}>
				<ForIntlProvider/>
			</Provider>
		)
	}
}

But it was not successful. In order to use react-intl, App_ should be wrapped by IntlProvider which needs mobx store as well.

Now react-native-mobx just uses store props in Router component.

What shall I do?

@ChrisJamesC
Copy link

I created a small library that might help you https://github.com/Sqooba/mobx-react-intl/blob/master/README.md . The goal is to integrate mobx-react with react-intl. I didn't test it on react-native yet though.

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