-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
32 lines (28 loc) · 1.07 KB
/
App.tsx
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
import React from "react";
import { Provider } from "react-redux";
import ReduxThunk from "redux-thunk";
import { createStore, combineReducers, applyMiddleware } from "redux";
import { persistStore, persistReducer } from "redux-persist";
import { PersistGate } from "redux-persist/integration/react";
import { ToastProvider } from "react-native-toast-notifications";
import transactionsReducer from "./src/store/reducers/transactions";
import userReducer from "./src/store/reducers/user";
import { persistConfig } from "./src/store/store";
import Index from "./src/screens";
const rootReducer = combineReducers({
transactions: persistReducer(persistConfig, transactionsReducer),
user: persistReducer(persistConfig, userReducer),
});
const store = createStore(rootReducer, applyMiddleware(ReduxThunk));
const persistor = persistStore(store);
export default function App() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ToastProvider>
<Index />
</ToastProvider>
</PersistGate>
</Provider>
);
}