Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import "./TabbedTable.less";
export default class TabbedTable extends React.PureComponent {
static cssClass = {
TAB_BAR: "TabbedTable--TabBar",
TITLE: "TabbedTable--Title",
TABS: "TabbedTable--Tabs",
TAB_NAME: "TabbedTable--TabName",
SELECTED_TAB_NAME: "TabbedTable--SelectedTabName",
};
static propTypes = {
children: PropTypes.arrayOf(PropTypes.oneOfType([
MorePropTypes.instanceOfComponent(Tab),
PropTypes.oneOf([null, false]), // allow for conditionally including tabs
])).isRequired,
title: PropTypes.string,
};
constructor(props) {
super(props);
this.state = {
selectedTabIndex: 0,
};
}
_onSelect(e, tabIndex) {
e.preventDefault();
this.setState({selectedTabIndex: tabIndex});