Skip to content

Commit 6eefeed

Browse files
Rody-Kirwanshockey
authored andcommitted
Fix/remove unknown props (#5372)
* improvement: OAS3 $ref friendly-name regex in model.jsx (via #5334) * improvement: relax schema description styling so Markdown can be effective (via #5340) * improvement: add `isShown` check to <ModelCollapse />'s prop `expanded` logic (via #5331) * security: CVE-2018-20834 (via #5368) * bump minimum `bundlesize` version * bump `node-sass` * bump webpack + webpack-dev-server; update lockfile * release: v3.22.2 * Filter unknown props from being applied to native button (React Warning) * Filter props without lodash
1 parent a089496 commit 6eefeed

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/core/components/layout-utils.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@ export class Button extends React.Component {
118118
mod: "primary"
119119
}
120120

121-
defaultClasses = () => !this.props.unstyled ? `sui-btn sui-btn--${this.props.mod}` : ""
121+
defaultClasses = ({ unstyled, mod }) => !unstyled ? `sui-btn sui-btn--${mod}` : ""
122122

123123
render() {
124+
const { unstyled, mod, className, ...props } = this.props
125+
124126
return (
125127
<button
126-
{...this.props}
127-
className={xclass(this.props.className, this.defaultClasses())}
128+
{...props}
129+
className={xclass(className, this.defaultClasses({ unstyled, mod }))}
128130
/>
129131
)
130132
}

0 commit comments

Comments
 (0)