/** * * LimitSelect * */ import React from 'react'; import _ from 'lodash'; import styles from './styles.scss'; class LimitSelect extends React.Component { componentWillMount() { const id = _.uniqueId(); this.setState({ id }); } shouldComponentUpdate() { return false; } /** * Return the list of default values to populate the select options * * @returns {number[]} */ getOptionsValues() { return [10, 20, 50, 100]; } render() { // Generate options const options = this.getOptionsValues().map(optionValue => ( )); // Get id in order to link the `label` and the `select` elements const id = this.state.id; return (
); } } LimitSelect.propTypes = { onLimitChange: React.PropTypes.func.isRequired, }; export default LimitSelect;