Skip to content

Commit 430c3d3

Browse files
author
Simon he
committed
chore: update
1 parent 0007134 commit 430c3d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sThree.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,14 @@ export function sThree(container: HTMLElement | string, options: SThreeOptions):
382382
})
383383
}
384384
scene!._add = function (...args: any[]) {
385-
scene!.add(...args)
385+
scene.add(...args)
386386
const result = args.map(arg => () => unmount(arg))
387387
return result.length === 1 ? result[0] : result
388388
function unmount(arg: Mesh) {
389389
const { material, geometry } = arg;
390390
(material as any).dispose()
391391
geometry.dispose()
392-
scene!.remove(arg)
392+
scene.remove(arg)
393393
}
394394
}
395395
createMesh?.()
@@ -419,7 +419,7 @@ export function sThree(container: HTMLElement | string, options: SThreeOptions):
419419
})
420420
resize()
421421
addEventListener(window, 'resize', resize)
422-
useMutationObserver((container as HTMLElement)?.parentNode, (mutations) => {
422+
useMutationObserver((container as HTMLElement)?.parentNode, (mutations: MutationRecord[]) => {
423423
mutations.forEach((mutation) => {
424424
mutation.removedNodes.forEach((node) => {
425425
if (node === container)

0 commit comments

Comments
 (0)