-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.ios.js
47 lines (39 loc) · 1.12 KB
/
index.ios.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
/**
* React Native Redux Example
* https://github.com/aaronvb/react-native-redux-example
*/
import React, { Component } from "react";
import { Provider } from "react-redux";
import { applyMiddleware, createStore } from "redux";
import logger from "redux-logger";
import { AppRegistry, StyleSheet, View, StatusBar } from "react-native";
import itemApp from "./reducers";
import Header from "./components/Header";
import ItemList from "./components/ItemList";
// Create store with logger.
// Use Cmd + D to open developer menu to start debugger
const store = createStore(itemApp, applyMiddleware(logger));
class ReduxExample extends Component {
componentDidMount() {
// Set status bar text to white
StatusBar.setHidden(false);
StatusBar.setBarStyle("light-content");
}
render() {
return (
<Provider store={store}>
<View style={styles.container}>
<Header />
<ItemList />
</View>
</Provider>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1
}
});
export default ReduxExample;
AppRegistry.registerComponent("ReduxExample", () => ReduxExample);