-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
42 lines (37 loc) · 1.27 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
import 'react-native-gesture-handler';
import React, { useState, useEffect } from "react";
import { AppLoading } from "expo";
import { createStore, combineReducers, applyMiddleware} from 'redux';
import thunkMiddleware from 'redux-thunk';
import { Provider } from 'react-redux';
import { functions } from './constants';
import MainNavigation from "./navigation/MainNavigation.js"
//reducers
import registerReducer from './store/reducers/register.js';
import authReducer from './store/reducers/auth.js';
import recorridoActivoReducer from './store/reducers/recorridoActivo.js';
// Store
const authenticationReducer = combineReducers({
register: registerReducer,
auth: authReducer,
recorridoActivo: recorridoActivoReducer,
})
const authenticationStore = createStore(authenticationReducer, applyMiddleware(thunkMiddleware));
export default function App() {
const [isLoadingComplete, setIsLoadingComplete] = useState(false);
console.disableYellowBox = true;
if (!isLoadingComplete) {
return (
<AppLoading
startAsync={functions.loadAssetsAsync}
onError={(error) => console.log(error)}
onFinish={() => setIsLoadingComplete(true)}
/>
);
}
return(
<Provider store={authenticationStore}>
<MainNavigation />
</Provider>
);
}