Created
May 15, 2020 02:25
-
-
Save crrmacarse/e9bc4253b37bcb2746aa01dcde1d0b08 to your computer and use it in GitHub Desktop.
Preloading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'providers/message'; | |
import 'core-js/stable'; | |
import 'regenerator-runtime/runtime'; | |
import 'raf/polyfill'; | |
import 'scss/index.scss'; | |
import 'providers/sentry'; | |
import React from 'react'; | |
import { hydrate } from 'react-dom'; | |
import { Provider as ReduxProvider } from 'react-redux'; | |
import Providers from 'providers'; | |
import storeConfig from 'providers/store'; | |
// import { loadableReady } from '@loadable/component'; | |
import * as serviceWorker from 'providers/service-worker'; | |
/* eslint-disable no-underscore-dangle */ | |
const initialState = window && (window as any).__PRELOADED_STATE__; | |
delete (window as any).__PRELOADED_STATE__; | |
/* eslint-enable */ | |
const initialStore = storeConfig(initialState); | |
const docRoot = document.getElementById('root'); | |
const app = ( | |
<ReduxProvider store={initialStore}> | |
<Providers /> | |
</ReduxProvider> | |
); | |
hydrate(app, docRoot); | |
serviceWorker.register(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment