LT21: shapeFromChildren reads a Text3D's and a BufferMesh's props as their own types again, one if per type, so tools/sdk-props sees BufferMesh's seven props read (positions, normals, uvs, colors, indices, attributes, copies: 0 unread). The fragment-aware loop is kept: a shape inside a fragment is still the mesh's shape (conformance/detail.test.tsx).

This commit is contained in:
shinyobjectz committed 2026-11-17 19:52:34 -08:00
1 parent a3fec64205
commit df8c577fc3
1 file changed
+7 -2
+7 -2
View File
@@ -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<string, unknown>;
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<Text3DProps>).props);
}
if (child.type === BufferMesh) {
return bufferShape((child as ReactElement<BufferMeshProps>).props);
}
const s = GEOMETRY_SHAPES.get(child.type)?.((child as ReactElement<Record<string, unknown>>).props);
if (s !== undefined) return s;
}
return undefined;