import React from "react" ; import ReactDOM from "react-dom" ; import { BrowserRouter as Router } from "react-router-dom" ; import { unregister } from "./service-worker" ; import App from "./app" ; import GlobalStyle from "./components/global-style" ; unregister ( ) ; const rootEl = document . getElementById ( "root" ) ; const render = ( Component ) => ReactDOM . render ( < Router > < div > < GlobalStyle /> < Component / > < /div> < /Router>, rootEl); render ( App ) ; if ( module . hot ) { module . hot . accept ( "./app" , ( ) => { const NextApp = require ( "./app" ) . default ; render ( NextApp ) ; } ) ; }