diff --git a/src/core/misc/StatsGl.ts b/src/core/misc/StatsGl.ts index 08c4d085..6446aaab 100644 --- a/src/core/misc/StatsGl.ts +++ b/src/core/misc/StatsGl.ts @@ -93,7 +93,9 @@ export const StatsGl = defineComponent({ expose({ statsGl }) const node = document.body - node?.appendChild(statsGl.dom) + const statContainer = statsGl.dom || statsGl.container + + node?.appendChild(statContainer) const { renderer } = useTresContext() const { onAfterLoop, resume } = useRenderLoop() @@ -106,7 +108,8 @@ export const StatsGl = defineComponent({ }) onUnmounted(() => { - node?.removeChild(statsGl.dom) + node?.removeChild(statContainer) }) }, + })