From 74b519959b2c23eb5bb5182c664335aaa63ea34d Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 13 Mar 2020 10:49:17 -0300 Subject: [PATCH] Fix Tab prop type warning (#8185) The props `isActive` and `tabIndex of the Tab component are required and are always passed in, but the prop type warning is triggered because the tabs are rendered without these props first, then cloned by the `Tabs` component, where these props are added. To silence the warning, the props have been made optional. --- ui/app/components/ui/tabs/tab/tab.component.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/components/ui/tabs/tab/tab.component.js b/ui/app/components/ui/tabs/tab/tab.component.js index a238dafd3..6f847be49 100644 --- a/ui/app/components/ui/tabs/tab/tab.component.js +++ b/ui/app/components/ui/tabs/tab/tab.component.js @@ -24,10 +24,10 @@ const Tab = (props) => { Tab.propTypes = { className: PropTypes.string, - isActive: PropTypes.bool.isRequired, + isActive: PropTypes.bool, // required, but added using React.cloneElement name: PropTypes.string.isRequired, onClick: PropTypes.func, - tabIndex: PropTypes.number.isRequired, + tabIndex: PropTypes.number, // required, but added using React.cloneElement } Tab.defaultProps = {