Mod Entry

This commit is contained in:
MrKBear 2022-02-06 00:29:58 +08:00
parent 0d8ccf2b5f
commit e0500fd6e8
3 changed files with 27 additions and 8 deletions

View File

@ -0,0 +1,12 @@
html {
font-family: sans-serif;
font-size: 100%;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body{
margin: 0;
padding: 0;
border: 0;
}

View File

@ -1,5 +1,6 @@
import { Component, ReactNode, StrictMode } from "react";
import { Component, ReactNode, StrictMode, FunctionComponent } from "react";
import { render } from "react-dom";
import "./Entry.scss";
class Entry extends Component<{}, {}> {
@ -15,6 +16,15 @@ class Entry extends Component<{}, {}> {
*
* @param component
*/
public static renderComponent(component: new () => Component) {
public static renderComponent(
RenderComponent: (new (...p: any) => Component) | FunctionComponent
) {
render(
<Entry><RenderComponent/></Entry>,
document.getElementById("root")
);
}
}
export default Entry;
export { Entry };

View File

@ -1,6 +1,6 @@
import { Component, ReactNode, StrictMode } from "react";
import { render } from "react-dom";
import { Group } from "@Model/Group";
import { Entry } from "../Entry/Entry";
import "./Laboratory.scss";
class Test extends Component {
@ -12,9 +12,6 @@ class Test extends Component {
}
}
render(
<StrictMode><Test></Test></StrictMode>,
document.getElementById("root")
);
Entry.renderComponent(Test);
console.log(new Group);