Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(client): disable react-hot-loader warnings
Browse files Browse the repository at this point in the history
fix(client): disable react-hot-loader warnings
  • Loading branch information
Metnew committed Dec 3, 2017
1 parent 9952102 commit 46fb13e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/client/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import 'semantic-ui-css/components/loader.css'
import 'semantic-ui-css/components/reset.css'
import 'semantic-ui-css/components/sidebar.css'
import 'semantic-ui-css/components/site.css'
// Polyfill fetch
/** {@link: https://github.com/NYTimes/kyt/issues/227} */
// NOTE: have some questions about polyfilling server
// babel polyfill (ie 10-11) + fetch polyfill
import 'babel-polyfill'
import 'isomorphic-fetch'
// Application
Expand All @@ -32,19 +30,18 @@ import {hydrate} from 'react-dom'
import {AsyncComponentProvider} from 'react-async-component'
import asyncBootstrapper from 'react-async-bootstrapper'
import {configureApp, configureRootComponent} from 'common/app'
import {AppContainer} from 'react-hot-loader'
import type {GlobalState} from 'reducers'
import type {i18nConfigObject} from 'types'

if (process.env.NODE_ENV === 'production') {
require('common/pwa')
} else if (process.env.NODE_ENV === 'development') {
}

const initialState: GlobalState = window.__INITIAL_STATE__ || {}
const i18n: i18nConfigObject = window.__I18N__ || {}
const asyncState: Object = window.__ASYNC_STATE__ || {}
// NOTE: V8 doesn't optimize `delete`
// delete window.__INITIAL_STATE__

const {store, routes, history} = configureApp(initialState)
const RootComponent = configureRootComponent({
store,
Expand All @@ -54,9 +51,11 @@ const RootComponent = configureRootComponent({
})

const app = (
<AsyncComponentProvider rehydrateState={asyncState}>
{RootComponent}
</AsyncComponentProvider>
<AppContainer warnings={false}>
<AsyncComponentProvider rehydrateState={asyncState}>
{RootComponent}
</AsyncComponentProvider>
</AppContainer>
)

asyncBootstrapper(app).then(() => {
Expand Down

0 comments on commit 46fb13e

Please sign in to comment.