Skip to content

Commit

Permalink
fix(cmpts): types error
Browse files Browse the repository at this point in the history
  • Loading branch information
FradSer committed May 4, 2023
1 parent 515e335 commit c614844
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/WebXR/Html.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c614844

Please sign in to comment.