Files
vscode-debug-visualizer/webview/src/index.tsx
Henning Dieterichs 07132b759a Initial commit
2019-06-20 11:41:10 +02:00

28 lines
718 B
TypeScript

import * as React from "react";
import * as ReactDOM from "react-dom";
import "./style.scss";
import App = require("./App");
import { Model } from "./Model";
const model = new Model();
function render(target: HTMLDivElement, app: typeof App) {
ReactDOM.render(<app.GUI model={model} />, target);
}
const target = document.createElement("div");
target.className = "root";
render(target, App);
document.body.appendChild(target);
declare var module: { hot?: { accept: (componentName: string, callback: () => void) => void } };
declare var require: (name: string) => any;
if (module.hot) {
module.hot.accept("./App", () => {
console.log("render");
render(target, require("./App"));
});
}