import React from 'react' import PropTypes from 'prop-types' export default class Anchors extends React.PureComponent { constructor(props) { super(props) let defaultCategory = props.categories.filter( (category) => category.first, )[0] this.state = { selected: defaultCategory.name, } this.handleClick = this.handleClick.bind(this) } handleClick(e) { var index = e.currentTarget.getAttribute('data-index') var { categories, onAnchorClick } = this.props onAnchorClick(categories[index], index) } render() { var { categories, color, i18n, icons } = this.props, { selected } = this.state return ( ) } } Anchors.propTypes /* remove-proptypes */ = { categories: PropTypes.array, onAnchorClick: PropTypes.func, icons: PropTypes.object, } Anchors.defaultProps = { categories: [], onAnchorClick: () => {}, icons: {}, }