Feat: Frontend hardening
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
// Path: Frontend/src/entry-client.tsx
|
||||
|
||||
// @refresh reload
|
||||
import type { JSX } from "solid-js";
|
||||
import { mount, StartClient } from "@solidjs/start/client";
|
||||
|
||||
mount(() => <StartClient />, document.getElementById("app")!);
|
||||
const getAppRoot = (): HTMLElement => {
|
||||
const appRoot = document.getElementById("app");
|
||||
|
||||
if (!(appRoot instanceof HTMLElement)) {
|
||||
throw new Error("App root element '#app' was not found.");
|
||||
}
|
||||
|
||||
return appRoot;
|
||||
};
|
||||
|
||||
const mountApp = (): void => {
|
||||
mount((): JSX.Element => <StartClient />, getAppRoot());
|
||||
};
|
||||
|
||||
mountApp();
|
||||
|
||||
Reference in New Issue
Block a user