fix:先还原 custom 和 wrapper 的透传 (#1860)

This commit is contained in:
吴多益 2021-04-22 17:19:18 +08:00 committed by GitHub
parent 000a1b5423
commit 4c3bf8e038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View File

@ -107,8 +107,7 @@ export class Custom extends React.Component<CustomProps, object> {
wrapperComponent, wrapperComponent,
inline, inline,
translate: __, translate: __,
classnames: cx, classnames: cx
...rest
} = this.props; } = this.props;
const Component = wrapperComponent || inline ? 'span' : 'div'; const Component = wrapperComponent || inline ? 'span' : 'div';
return ( return (
@ -117,7 +116,6 @@ export class Custom extends React.Component<CustomProps, object> {
className={cx(className)} className={cx(className)}
id={id} id={id}
dangerouslySetInnerHTML={{__html: html ? html : ''}} dangerouslySetInnerHTML={{__html: html ? html : ''}}
{...rest}
></Component> ></Component>
); );
} }

View File

@ -53,20 +53,12 @@ export default class Wrapper extends React.Component<WrapperProps, object> {
} }
render() { render() {
const { const {className, size, classnames: cx, style} = this.props;
className,
size,
classnames: cx,
style,
translate: __,
...rest
} = this.props;
return ( return (
<div <div
className={cx('Wrapper', size ? `Wrapper--${size}` : '', className)} className={cx('Wrapper', size ? `Wrapper--${size}` : '', className)}
style={style} style={style}
{...rest}
> >
{this.renderBody()} {this.renderBody()}
</div> </div>