18 lines
437 B
JavaScript
18 lines
437 B
JavaScript
import * as React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
export default function TabPanel(props) {
|
|
const { children, value, index, ...other } = props;
|
|
return (
|
|
<div role="tabpanel" hidden={value !== index} {...other}>
|
|
{value === index && children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
TabPanel.propTypes = {
|
|
children: PropTypes.element.isRequired,
|
|
value: PropTypes.number.isRequired,
|
|
index: PropTypes.number.isRequired,
|
|
};
|