-
Notifications
You must be signed in to change notification settings - Fork 21
/
index.js
35 lines (28 loc) · 821 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
35
import React from 'react';
import { AppRegistry } from 'react-native';
import App from './App';
import { Provider } from 'react-redux'
import { createStore, applyMiddleware } from 'redux'
import reducer from './src/reducers/index.js'
import thunkMiddleware from 'redux-thunk'
import { createLogger } from 'redux-logger'
import Fetch from './src/middleware/http.js'
const logger = createLogger({
// logger options
});
const store = createStore(reducer, applyMiddleware(thunkMiddleware, Fetch ));
// console.log(" ---- store",store);
class Root extends React.Component {
constructor(props) {
super(props);
this.store = store
}
render() {
return (
<Provider store={ this.store }>
<App />
</Provider>
);
}
}
AppRegistry.registerComponent('react_native_project', () => Root);