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

View File

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