Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default class CustomGraphComponent extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- selectedOption: iconsData[0]
- };
- }
- handleSelect = (eventKey) => {
- this.props.onSelectOption(iconsData[eventKey]);
- console.log(iconsData[eventKey]);
- this.setState({ selectedOption: iconsData[eventKey] });
- }
- render() {
- var {onSelectOption} = this.props;
- return (
- <div style={{paddingTop:20}} >
- <DropdownButton title ={this.state.selectedOption} onSelect={this.handleSelect} >
- {
- iconsData.map((indexName, i) => {
- return (
- <MenuItem key={i} eventKey={i}>
- {indexName}
- </MenuItem>
- );
- })
- }
- </DropdownButton>
- </div>
- );
- }
- }
- CustomGraphComponent.propTypes = {
- onSelectOption : PropTypes.func
- }
Add Comment
Please, Sign In to add comment