diff --git a/sdk/render/src/3d/shapes.tsx b/sdk/render/src/3d/shapes.tsx index f7dcd524..8235ece8 100644 --- a/sdk/render/src/3d/shapes.tsx +++ b/sdk/render/src/3d/shapes.tsx @@ -448,8 +448,13 @@ const flat = (kids: ReactNode): ReactElement[] => Children.toArray(kids).flatMap export function shapeFromChildren(children: ReactNode): string | undefined { for (const child of flat(children)) { - const props = child.props as Record; - const s = child.type === Text3D ? text3dShape(props as unknown as Text3DProps) : child.type === BufferMesh ? bufferShape(props as unknown as BufferMeshProps) : GEOMETRY_SHAPES.get(child.type)?.(props); + if (child.type === Text3D) { + return text3dShape((child as ReactElement).props); + } + if (child.type === BufferMesh) { + return bufferShape((child as ReactElement).props); + } + const s = GEOMETRY_SHAPES.get(child.type)?.((child as ReactElement>).props); if (s !== undefined) return s; } return undefined;