part 1 of converting gang to react

This commit is contained in:
Olivier Gagnon
2021-06-14 15:42:38 -04:00
parent 67e5e413e4
commit 25f546c691
18 changed files with 1251 additions and 267 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ function getGameContainer(): void {
document.addEventListener("DOMContentLoaded", getGameContainer);
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function createPopup(id: string, rootComponent: ReactComponent, props: any): HTMLElement | null {
export function createPopup<T>(id: string, rootComponent: (props: T) => React.ReactElement, props: T): HTMLElement | null {
let container = document.getElementById(id);
if (container == null) {
container = createElement("div", {