mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 02:59:04 +08:00
chore: add isValidElement for isFragment (#38056)
This commit is contained in:
parent
14b83d97b5
commit
a2de8f7b2e
@ -3,7 +3,7 @@ import * as React from 'react';
|
||||
export const { isValidElement } = React;
|
||||
|
||||
export function isFragment(child: React.ReactElement): boolean {
|
||||
return child && child.type === React.Fragment;
|
||||
return child && isValidElement(child) && child.type === React.Fragment;
|
||||
}
|
||||
|
||||
type AnyObject = Record<PropertyKey, any>;
|
||||
|
Loading…
Reference in New Issue
Block a user