mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-23 11:46:44 +10:00
fix child null bug in FormItem
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user