-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
64 lines (56 loc) · 1.58 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// import React, { Component } from "react";
// import { AppRegistry } from 'react-native';
// import Router from './App/Routers/AppNavigation';
// import SplashScreen from './App/Screens/SplashStack/Splash';
// import { name as appName } from './app.json';
// class index extends Component {
// constructor(props) {
// super(props);
// this.state = {
// screen: "splash"
// };
// }
// componentWillMount() {
// setTimeout(() => {
// this.setState({ screen: "nav" });
// }, 2000);
// }
// render() {
// return this.state.screen === "splash" ? <SplashScreen /> : <Router />;
// }
// }
// console.disableYellowBox = true;
// AppRegistry.registerComponent(appName, () => index);
import React, { Component } from "react";
import { AppRegistry } from 'react-native';
import { Provider } from 'react-redux';
import axios from 'axios';
import thunk from 'redux-thunk';
import { createStore, applyMiddleware } from 'redux';
import { name as appName } from './app.json';
import reducer from './App/reducer';
import App from './App';
class index extends Component {
constructor(props) {
super(props);
this.state = {
screen: "splash"
};
}
render() {
const axiosInstance = axios.create({
baseURL: ''
});
const store = createStore(
reducer,
// applyMiddleware(thunk.withExtraArgument(axiosInstance), promise())
applyMiddleware(thunk.withExtraArgument(axiosInstance))
);
return (
<Provider store={store}>
<App />
</Provider>
)
}
}
AppRegistry.registerComponent(appName, () => index);