mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
fix child null bug in FormItem
This commit is contained in:
parent
7ce38e39b6
commit
ca2fca024a
@ -131,10 +131,9 @@ class FormItem extends React.Component {
|
||||
renderChildren() {
|
||||
const props = this.props;
|
||||
const children = React.Children.map(props.children, (child) => {
|
||||
if (typeof child.type === 'function' && !child.props.size) {
|
||||
if (child && typeof child.type === 'function' && !child.props.size) {
|
||||
return React.cloneElement(child, { size: 'large' });
|
||||
}
|
||||
|
||||
return child;
|
||||
});
|
||||
return [
|
||||
|
Loading…
Reference in New Issue
Block a user