From c8370b394c8295bde5c74c3b891546f215f8e0bb Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Tue, 27 Dec 2022 15:17:13 +0530 Subject: [PATCH] fix: use displayName since name gets stripped off when uglifying/minifiyng in production (#6036) fix: use displayName since name gets stripped off when uglifying/minifiy in production --- src/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 0f991c43..ffaf414d 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);