2018-01-17 14:43:28 -08:00
|
|
|
import React from 'react';
|
|
|
|
import { AppRegistry } from 'react-native';
|
|
|
|
import { Provider } from 'react-redux';
|
2018-02-02 14:58:35 -05:00
|
|
|
import { createStore, applyMiddleware } from 'redux';
|
2018-01-17 14:43:28 -08:00
|
|
|
|
|
|
|
import AppReducer from './src/reducers';
|
2018-06-15 02:15:11 +08:00
|
|
|
import { AppNavigator, middleware } from './src/navigators/AppNavigator';
|
2018-01-17 14:43:28 -08:00
|
|
|
|
2018-06-15 02:15:11 +08:00
|
|
|
const store = createStore(AppReducer, applyMiddleware(middleware));
|
2018-01-17 14:43:28 -08:00
|
|
|
|
2018-02-02 14:58:35 -05:00
|
|
|
class ReduxExampleApp extends React.Component {
|
2018-01-17 14:43:28 -08:00
|
|
|
render() {
|
|
|
|
return (
|
2018-02-02 14:58:35 -05:00
|
|
|
<Provider store={store}>
|
2018-06-15 02:15:11 +08:00
|
|
|
<AppNavigator />
|
2018-01-17 14:43:28 -08:00
|
|
|
</Provider>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AppRegistry.registerComponent('ReduxExample', () => ReduxExampleApp);
|
|
|
|
|
|
|
|
export default ReduxExampleApp;
|