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);