Browse Source

chore: add isValidElement for isFragment (#38056)

pull/38059/head
lijianan 2 years ago
committed by GitHub
parent
commit
a2de8f7b2e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/_util/reactNode.ts

2
components/_util/reactNode.ts

@ -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…
Cancel
Save