Merge pull request #18088 from ant-design/fix-noStyle

fix: `noStyle` throws react warning
This commit is contained in:
偏右 2019-08-05 16:59:42 +08:00 committed by GitHub
commit adc1879048
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,14 +54,14 @@ class TransButton extends React.Component<TransButtonProps> {
} }
render() { render() {
const { style, noStyle } = this.props; const { style, noStyle, ...restProps } = this.props;
return ( return (
<div <div
role="button" role="button"
tabIndex={0} tabIndex={0}
ref={this.setRef} ref={this.setRef}
{...this.props} {...restProps}
onKeyDown={this.onKeyDown} onKeyDown={this.onKeyDown}
onKeyUp={this.onKeyUp} onKeyUp={this.onKeyUp}
style={{ ...(!noStyle ? inlineStyle : null), ...style }} style={{ ...(!noStyle ? inlineStyle : null), ...style }}