From c614844dd2f5b9dce2b2de2bf218faf9a26bfcb4 Mon Sep 17 00:00:00 2001 From: Frad LEE Date: Fri, 5 May 2023 00:17:16 +0800 Subject: [PATCH] fix(cmpts): types error --- components/WebXR/Html.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/WebXR/Html.tsx b/components/WebXR/Html.tsx index caec90c..22e290f 100644 --- a/components/WebXR/Html.tsx +++ b/components/WebXR/Html.tsx @@ -16,7 +16,7 @@ HTMLCanvasElement.prototype.getContext = (function (origFn: any) { } })(HTMLCanvasElement.prototype.getContext) -let container: any | null = document.querySelector('#htmlContainer') +let container: HTMLElement | null = document.querySelector('#htmlContainer') if (!container) { const node = document.createElement('div') @@ -64,10 +64,10 @@ export default function Html({ }, [children]) useEffect(() => { - container.appendChild(node) + container!.appendChild(node) html2canvas(node, { backgroundColor: color }).then((canvas) => { - if (container.contains(node)) { - container.removeChild(node) + if (container!.contains(node)) { + container!.removeChild(node) } canvas.toBlob((blob) => { if (blob === null) return