Skip to content

Commit

Permalink
Fix/remove unknown props (#5372)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Rody-Kirwan authored and shockey committed May 28, 2019
1 parent a089496 commit 6eefeed
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/components/layout-utils.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ export class Button extends React.Component {
mod: "primary"
}

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

render() {
const { unstyled, mod, className, ...props } = this.props

return (
<button
{...this.props}
className={xclass(this.props.className, this.defaultClasses())}
{...props}
className={xclass(className, this.defaultClasses({ unstyled, mod }))}
/>
)
}
Expand Down

0 comments on commit 6eefeed

Please sign in to comment.