forked from jhta/movie-list-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.android.js
45 lines (39 loc) · 1.01 KB
/
index.android.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
36
37
38
39
40
41
42
43
44
45
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import { AppRegistry } from 'react-native';
import { StackNavigator } from 'react-navigation';
import MovieView from './src/views/Detail';
import DiscoverView from './src/views/Discover';
import reducer from './src/reducers/movies.js';
import createSagaMiddleware from 'redux-saga';
import rootSaga from './src/sagas/movies.js';
const AppNavigation = StackNavigator({
Main: {
screen: DiscoverView,
},
Movie: {
screen: MovieView
}
});
const sagaMiddleware = createSagaMiddleware();
const store = createStore(
reducer,
applyMiddleware(sagaMiddleware)
);
sagaMiddleware.run(rootSaga);
class App extends Component {
render() {
return (
<Provider store={store}>
<AppNavigation />
</Provider>
);
}
}
AppRegistry.registerComponent('AwesomeProject', () => App);