Open platform to collect and prioritize feedback
more refactor
goenningbbe3cbe3f613
diff --git a/public/index.ts b/public/index.tsdeleted file mode 100644index 92f488968..000000000--- a/public/index.ts+++ /dev/null@@ -1,7 +0,0 @@-import init from "./init";-import { setup } from "./storage";--import "./css/main.css";--setup();-document.addEventListener("DOMContentLoaded", init);diff --git a/public/init.tsx b/public/index.tsxsimilarity index 61%rename from public/init.tsxrename to public/index.tsxindex 57ceb6bfc..84b9bfb64 100644--- a/public/init.tsx+++ b/public/index.tsx@@ -2,7 +2,10 @@ import * as React from "react";import * as ReactDOM from "react-dom";import { Root } from "./components/Root";-import { ShowIdeaRoot } from "./components/ShowIdeaRoot";+import { ShowIdeaRoot } from "./components/show_idea_root";+import { setup } from "./storage";++import "./css/main.css";const pathRegex = [{ regex: new RegExp("^\/$"), component: <Root /> },@@ -19,9 +22,11 @@ const resolveRootComponent = (path: string): JSX.Element => {return <div />;};-export default function init() {- ReactDOM.render(- resolveRootComponent(location.pathname),- document.getElementById("root")- );-}+setup();++document.addEventListener("DOMContentLoaded", () => {+ ReactDOM.render(+ resolveRootComponent(location.pathname),+ document.getElementById("root")+ );+});diff --git a/webpack.config.js b/webpack.config.jsindex 528aff7eb..f386143ab 100755--- a/webpack.config.js+++ b/webpack.config.js@@ -2,7 +2,7 @@ const path = require('path');const CleanWebpackPlugin = require('clean-webpack-plugin');module.exports = {- entry: "./public/index.ts",+ entry: "./public/index.tsx",output: {path: __dirname + '/dist',filename: "js/bundle.[chunkhash].js",