Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: use displayName since name gets stripped off when uglifying/minifiyng in production (#6036)

Aakansha Doshic8370b394c82
diff --git a/src/utils.ts b/src/utils.ts
index 0f991c4374..ffaf414dea 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -701,10 +701,11 @@ export const ReactChildrenToObject = <
if (
React.isValidElement(child) &&
typeof child.type !== "string" &&
- child?.type.name
+ //@ts-ignore
+ child?.type.displayName
) {
// @ts-ignore
- acc[child.type.name] = child;
+ acc[child.type.displayName] = child;
}
return acc;
}, {} as Partial<T>);