mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
35 lines
1,019 B
TypeScript
35 lines
1,019 B
TypeScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
|
|
import { App } from '~/containers/App';
|
|
import '~/styles/main.less';
|
|
|
|
import { Provider } from 'react-redux';
|
|
import { PersistGate } from 'redux-persist/integration/react';
|
|
import { configureStore } from '~/redux/store';
|
|
import { pushLoaderState } from '~/utils/history';
|
|
|
|
const { store, persistor } = configureStore();
|
|
|
|
pushLoaderState(10);
|
|
|
|
export const Index = () => (
|
|
<Provider store={store}>
|
|
<PersistGate loading={null} persistor={persistor}>
|
|
<App />
|
|
</PersistGate>
|
|
</Provider>
|
|
);
|
|
|
|
ReactDOM.render(<Index />, document.getElementById('index'));
|
|
|
|
if (process.env.NODE_ENV && process.env.NODE_ENV !== 'development') {
|
|
(function() {
|
|
if ('serviceWorker' in navigator) {
|
|
navigator.serviceWorker
|
|
.register('./service-worker.js', { scope: '/' })
|
|
.then(() => console.log('Service Worker registered successfully.'))
|
|
.catch(error => console.log('Service Worker registration failed:', error));
|
|
}
|
|
})();
|
|
}
|