tweak insert space logic of loading button

This commit is contained in:
afc163 2018-05-01 19:33:38 +08:00
parent 726f0466bc
commit c7471a4653

View File

@ -156,9 +156,8 @@ export default class Button extends React.Component<ButtonProps, any> {
}
isNeedInserted() {
const { loading, icon, children } = this.props;
const iconType = loading ? 'loading' : icon;
return React.Children.count(children) === 1 && (!iconType || iconType === 'loading');
const { icon, children } = this.props;
return React.Children.count(children) === 1 && !icon;
}
render() {