🐛 Fix Button loading prop warning (#18208)

close #18205
This commit is contained in:
偏右 2019-08-11 16:32:55 +08:00 committed by GitHub
parent 33a5da4e9a
commit aa2ed79770
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
? spaceChildren(children, this.isNeedInserted() && autoInsertSpace)
: null;
const linkButtonRestProps = omit(rest as AnchorButtonProps, ['htmlType']);
const linkButtonRestProps = omit(rest as AnchorButtonProps, ['htmlType', 'loading']);
if (linkButtonRestProps.href !== undefined) {
return (
<a
@ -291,7 +291,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
const buttonNode = (
<button
{...omit(otherProps, ['loading']) as NativeButtonProps}
{...(omit(otherProps, ['loading']) as NativeButtonProps)}
type={htmlType}
className={classes}
onClick={this.handleClick}