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
This commit is contained in:
parent
5fcf6a4845
commit
c8370b394c
@ -701,10 +701,11 @@ export const ReactChildrenToObject = <
|
|||||||
if (
|
if (
|
||||||
React.isValidElement(child) &&
|
React.isValidElement(child) &&
|
||||||
typeof child.type !== "string" &&
|
typeof child.type !== "string" &&
|
||||||
child?.type.name
|
//@ts-ignore
|
||||||
|
child?.type.displayName
|
||||||
) {
|
) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
acc[child.type.name] = child;
|
acc[child.type.displayName] = child;
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Partial<T>);
|
}, {} as Partial<T>);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user