Skip to content

Commit

Permalink
minor fix by code review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo committed Aug 17, 2017
1 parent 4950be2 commit f7f4c4a
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class ColorSchemeControl extends React.PureComponent {
};

this.onChange = this.onChange.bind(this);
this.optionRender = this.optionRender.bind(this);
this.renderOption = this.renderOption.bind(this);
}

onChange(option) {
Expand All @@ -40,9 +40,9 @@ export default class ColorSchemeControl extends React.PureComponent {
this.setState({ scheme: optionValue });
}

optionRender(key) {
const currentScheme = key ?
this.props.schemes[key] :
renderOption(key) {
const currentScheme = key.value ?
this.props.schemes[key.value] :
this.props.schemes[defaultProps.value];

let colors = currentScheme;
Expand Down Expand Up @@ -71,14 +71,13 @@ export default class ColorSchemeControl extends React.PureComponent {
autosize: false,
clearable: false,
onChange: this.onChange,
optionRenderer: opt => this.optionRender(opt.value),
valueRenderer: opt => this.optionRender(opt.value),
optionRenderer: this.renderOption,
valueRenderer: this.renderOption,
};
const selectWrap = (<Creatable {...selectProps} />);
return (
<div>
<ControlHeader {...this.props} />
{selectWrap}
<Creatable {...selectProps} />
</div>
);
}
Expand Down

0 comments on commit f7f4c4a

Please sign in to comment.