-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.js
50 lines (41 loc) · 1.21 KB
/
App.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
46
47
48
import React, {Component} from 'react';
import ReduxThunk from 'redux-thunk';
import Weather from './src/components/Weather';
import Details from './src/components/Details';
import { createStackNavigator, createAppContainer } from "react-navigation";
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import { reducer } from './src/reducer';
const store = createStore(reducer, applyMiddleware(ReduxThunk));
const AppNavigator = createStackNavigator(
{
Home: {screen: Weather, navigationOptions: {title: 'Weather App',}},
Details: {screen: Details, navigationOptions: {title: 'Weather App',}}
},
{
initialRouteName: "Home",
defaultNavigationOptions: {
headerStyle: {
backgroundColor: '#A3D4F7',
elevation: 0,
shadowOpacity: 0,
},
headerTintColor: '#333333',
headerTitleStyle: {
fontWeight: 'bold',
color: '#ffffff'
}
}
},
);
const AppContainer = createAppContainer(AppNavigator);
export default class App extends Component {
render() {
console.log("render from App");
return (
<Provider store={store}>
<AppContainer />
</Provider>
);
}
}