import { AppContainer , hot } from 'react-hot-loader' ; import * as React from 'react' ; import { render } from 'react-dom' ; import App from './components/app' ; import './index.css' ; const rootEl = document . getElementById ( 'root' ) ; render ( < AppContainer > < App /> < /AppContainer>, rootEl); if ( ( module as any ) . hot ) { ( module as any ) . hot . accept ( './components/app' , ( ) => { const NewApp = require ( './components/app' ) . default ; render ( < AppContainer > < NewApp /> < /AppContainer>, rootEl); } ) ; }