Explorar el Código

Merge pull request #227 from Tresjs/bugfix/docs-scenes-broken-potential-fix-vnodes-insert

fix: optional chaining on insert vnodes
Alvaro Saburido hace 2 años
padre
commit
b18aa96148
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/core/nodeOps.ts

+ 1 - 1
src/core/nodeOps.ts

@@ -78,7 +78,7 @@ export const nodeOps: RendererOptions<TresObject, TresObject> = {
   },
   insert(child, parent) {
     if (
-      (child?.__vnode.type === 'TresGroup' || child?.__vnode.type === 'TresObject3D') &&
+      (child?.__vnode?.type === 'TresGroup' || child?.__vnode?.type === 'TresObject3D') &&
       parent === null &&
       !child?.__vnode?.ctx?.asyncResolved
     ) {