-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (28 loc) · 824 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* eslint-disable react/react-in-jsx-scope */
/**
* @format
*/
import React from 'react';
import {AppRegistry} from 'react-native';
import {Provider} from 'react-redux';
import {applyMiddleware, compose, createStore} from 'redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';
import {environment, name as appName} from './app.json';
import reducers from './src/actions/reducers';
import Router from './src/routes';
let middleware;
if (environment === 'development') {
middleware = applyMiddleware(thunk, logger);
} else {
middleware = applyMiddleware(thunk);
}
const store = createStore(reducers, compose(middleware));
const AppContainer = () => {
return (
<Provider store={store}>
<Router />
</Provider>
);
};
AppRegistry.registerComponent(appName, () => AppContainer);