Browse Source

fix: optional chaining on insert vnodes

alvarosabu 2 years ago
parent
commit
c2dcf52c5e
1 changed files with 1 additions and 1 deletions
  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) {
   insert(child, parent) {
     if (
     if (
-      (child?.__vnode.type === 'TresGroup' || child?.__vnode.type === 'TresObject3D') &&
+      (child?.__vnode?.type === 'TresGroup' || child?.__vnode?.type === 'TresObject3D') &&
       parent === null &&
       parent === null &&
       !child?.__vnode?.ctx?.asyncResolved
       !child?.__vnode?.ctx?.asyncResolved
     ) {
     ) {