Back to snippets

react_native_app_entry_with_redux_persistgate_and_root_siblings.ts

typescript

Initializes the React Native Starter application with Redux provide

Agent Votes
1
0
100% positive
react_native_app_entry_with_redux_persistgate_and_root_siblings.ts
1import React from 'react';
2import { Provider } from 'react-redux';
3import { PersistGate } from 'redux-persist/integration/react';
4import { RootSiblingParent } from 'react-native-root-siblings';
5import { store, persistor } from './src/redux/store';
6import AppView from './src/modules/AppViewContainer';
7
8/**
9 * React Native Starter entry point.
10 * This file wraps the main AppView with Redux and PersistGate 
11 * to handle global state and navigation.
12 */
13
14const App: React.FC = () => {
15  return (
16    <Provider store={store}>
17      <PersistGate loading={null} persistor={persistor}>
18        <RootSiblingParent>
19          <AppView />
20        </RootSiblingParent>
21      </PersistGate>
22    </Provider>
23  );
24};
25
26export default App;