31 lines
634 B
TypeScript
31 lines
634 B
TypeScript
import * as React from "react";
|
|
import {render} from "react-dom";
|
|
import {AppContainer} from "react-hot-loader";
|
|
import App from "./components/App";
|
|
import "./index.scss";
|
|
|
|
const rootEl = document.getElementById("root");
|
|
|
|
render(
|
|
<AppContainer>
|
|
<App/>
|
|
</AppContainer>,
|
|
rootEl
|
|
);
|
|
|
|
// Hot Module Replacement API
|
|
declare const module: { hot: any };
|
|
|
|
if (module.hot) {
|
|
module.hot.accept("./components/App", () => {
|
|
const NewApp = require("./components/App").default;
|
|
|
|
render(
|
|
<AppContainer>
|
|
<NewApp/>
|
|
</AppContainer>,
|
|
rootEl
|
|
);
|
|
});
|
|
}
|