From 017e3ecf7c1e3f9e4a164d2893bac9d1089a8b66 Mon Sep 17 00:00:00 2001 From: Matt Huggins Date: Sun, 5 Aug 2018 08:38:50 -0500 Subject: [PATCH 1/5] chore(button): forward refs to button dom element --- .../shared/components/Forms/Button/Button.js | 41 ++++++++----------- .../shared/components/Forms/Button/index.js | 6 ++- .../Forms/PrimaryButton/PrimaryButton.js | 37 +++++++---------- .../components/Forms/PrimaryButton/index.js | 6 ++- src/renderer/shared/hocs/withForwardedRef.js | 10 +++++ 5 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 src/renderer/shared/hocs/withForwardedRef.js diff --git a/src/renderer/shared/components/Forms/Button/Button.js b/src/renderer/shared/components/Forms/Button/Button.js index 0ec09f5e6..de44cea8e 100644 --- a/src/renderer/shared/components/Forms/Button/Button.js +++ b/src/renderer/shared/components/Forms/Button/Button.js @@ -1,39 +1,30 @@ import React from 'react'; import classNames from 'classnames'; -import { string } from 'prop-types'; +import { string, func } from 'prop-types'; +import { omit } from 'lodash'; import styles from './Button.scss'; export default class Button extends React.PureComponent { + static propTypes = { + className: string, + type: string, + forwardedRef: func + }; + + static defaultProps = { + className: null, + type: 'button', + forwardedRef: null + }; + render() { return ( // eslint-disable-next-line react/button-has-type