From 72fe73662c04f40f721d5bcb247db06e134f2101 Mon Sep 17 00:00:00 2001 From: emyarod Date: Tue, 8 Dec 2020 10:41:30 -0600 Subject: [PATCH 1/2] fix(Tab): implement renderButton support --- packages/react/src/components/Tab/Tab.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/react/src/components/Tab/Tab.js b/packages/react/src/components/Tab/Tab.js index 4027eddb9b2f..b6d56ae7269f 100644 --- a/packages/react/src/components/Tab/Tab.js +++ b/packages/react/src/components/Tab/Tab.js @@ -73,6 +73,7 @@ export default class Tab extends React.Component { * side router libraries. **/ renderAnchor: deprecate(PropTypes.func), + renderButton: PropTypes.func, /* * An optional parameter to allow overriding the content rendering. @@ -119,7 +120,8 @@ export default class Tab extends React.Component { onClick, onKeyDown, // TODO: rename renderAnchor to renderButton in next major version - renderAnchor: renderButton, + renderAnchor, + renderButton, renderContent, // eslint-disable-line no-unused-vars ...other } = this.props; @@ -153,6 +155,8 @@ export default class Tab extends React.Component { }, }; + const renderElement = renderButton || renderAnchor; + return (
  • - {renderButton ? ( - renderButton(buttonProps) + {renderElement ? ( + renderElement(buttonProps) ) : (