1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

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.
This commit is contained in:
Mark Stacey 2020-03-13 10:49:17 -03:00 committed by GitHub
parent 61fdb56864
commit 74b519959b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = {