-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
29 lines (26 loc) · 955 Bytes
/
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
import { ColorModeScript } from '@chakra-ui/react';
import { Provider } from 'react-redux';
import { store, persistor } from './app/store';
import * as ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom'; // import BrowserRouter
import App from './App';
import * as serviceWorker from './serviceWorker';
import { createStandaloneToast } from '@chakra-ui/react'
import { PersistGate } from 'redux-persist/integration/react';
const container = document.getElementById('root');
const root = ReactDOM.createRoot(container);
const { ToastContainer } = createStandaloneToast()
root.render(
<>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<ColorModeScript />
<BrowserRouter> {/* wrap App component inside BrowserRouter */}
<App />
<ToastContainer />
</BrowserRouter>
</PersistGate>
</Provider>
</>
);
serviceWorker.unregister();