import React from 'react'; export default class Tab extends React.PureComponent { constructor() { super(); this.state = { hovered: false }; } handleHover = () => { this.setState({ hovered: true }); }; handleBlur = () => { this.setState({ hovered: false }); }; handleClick = event => { const isLeftClick = event.nativeEvent.which === 1; if (isLeftClick && !this.props.isActive) { this.props.onSelect(); } }; handleMouseUp = event => { const isMiddleClick = event.nativeEvent.which === 2; if (isMiddleClick) { this.props.onClose(); } }; render() { const {isActive, isFirst, isLast, borderColor, hasActivity} = this.props; const {hovered} = this.state; return (
  • {this.props.customChildrenBefore} {this.props.text} {this.props.customChildren}
  • ); } }