Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit f6c7f50

Browse files
committed
feat: redux integration is here but needs some example
1 parent 35efedf commit f6c7f50

File tree

10 files changed

+1717
-350
lines changed

10 files changed

+1717
-350
lines changed

App.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
import "react-native-gesture-handler";
22
import React from "react";
33
import { StatusBar, useColorScheme, LogBox } from "react-native";
4+
import { Provider } from "react-redux";
45
import SplashScreen from "react-native-splash-screen";
6+
import { PersistGate } from "redux-persist/integration/react";
7+
import { isAndroid } from "@freakycoder/react-native-helpers";
58
/**
69
* ? Local Imports
710
*/
811
import Navigation from "./src/navigation";
9-
import { isAndroid } from "@freakycoder/react-native-helpers";
12+
import { store, persistor } from "./src/services/redux/Store";
13+
import { initializeReduxService } from "@services/redux/ReduxService";
1014

1115
LogBox.ignoreAllLogs();
1216

1317
const App = () => {
1418
const scheme = useColorScheme();
1519
const isDarkMode = scheme === "dark";
1620

21+
React.useLayoutEffect(() => {
22+
initializeReduxService(store.dispatch, store.getState);
23+
});
24+
1725
React.useEffect(() => {
1826
StatusBar.setBarStyle(isDarkMode ? "light-content" : "dark-content");
1927
if (isAndroid) {
@@ -27,9 +35,11 @@ const App = () => {
2735
}, [scheme, isDarkMode]);
2836

2937
return (
30-
<>
31-
<Navigation />
32-
</>
38+
<Provider store={store}>
39+
<PersistGate loading={null} persistor={persistor}>
40+
<Navigation />
41+
</PersistGate>
42+
</Provider>
3343
);
3444
};
3545

ios/RNTypescriptBoilerplate.xcodeproj/project.pbxproj

Lines changed: 56 additions & 56 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)