forked from reduxjs/redux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
30 lines (28 loc) · 854 Bytes
/
index.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
import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { ChakraProvider } from '@chakra-ui/react'
import App from './App'
import { store } from './app/store'
import { worker } from './mocks/browser'
import { Provider } from 'react-redux'
// Initialize the msw worker, wait for the service worker registration to resolve, then mount
worker
.start({ quiet: true })
.then(() => {
const rootNode = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement,
)
return rootNode.render(
<React.StrictMode>
<Provider store={store}>
<ChakraProvider>
<BrowserRouter>
<App />
</BrowserRouter>
</ChakraProvider>
</Provider>
</React.StrictMode>,
)
})
.catch(console.error)