From 4119bfbc22eccc3ec49523a02e971fad93bae943 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 22 Mar 2017 11:42:31 -0700 Subject: [PATCH] Use simpler rest parameter syntax instead of Object.assign for defining KuiButton propTypes. --- ui_framework/components/button/button.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/ui_framework/components/button/button.js b/ui_framework/components/button/button.js index fa6b142e752f7..308e27d6e021b 100644 --- a/ui_framework/components/button/button.js +++ b/ui_framework/components/button/button.js @@ -13,11 +13,7 @@ const commonPropTypes = { isDisabled: PropTypes.bool, onClick: PropTypes.func, data: PropTypes.any, - className: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.array, - PropTypes.object, - ]), + className: PropTypes.string, }; const getIcon = props => ( @@ -85,12 +81,13 @@ const KuiButton = props => { ); }; -KuiButton.propTypes = Object.assign({}, commonPropTypes, { +KuiButton.propTypes = { icon: PropTypes.node, isIconOnRight: PropTypes.bool, children: PropTypes.node, isLoading: PropTypes.bool, -}); + ...commonPropTypes, +}; const KuiLinkButton = props => { const icon = getIcon(props); @@ -108,14 +105,15 @@ const KuiLinkButton = props => { ); }; -KuiLinkButton.propTypes = Object.assign({}, commonPropTypes, { +KuiLinkButton.propTypes = { href: PropTypes.string, target: PropTypes.string, icon: PropTypes.node, isIconOnRight: PropTypes.bool, children: PropTypes.node, isLoading: PropTypes.bool, -}); + ...commonPropTypes, +}; const KuiSubmitButton = props => { const commonProps = getCommonProps(props); @@ -129,9 +127,10 @@ const KuiSubmitButton = props => { ); }; -KuiSubmitButton.propTypes = Object.assign({}, commonPropTypes, { +KuiSubmitButton.propTypes = { children: PropTypes.string, -}); + ...commonPropTypes, +}; KuiButton.TYPE = KuiSubmitButton.TYPE = KuiLinkButton.TYPE = keyMirror({ BASIC: null,