Skip to content

Commit

Permalink
Fix new lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypnosphi committed Nov 19, 2017
1 parent a8ffd99 commit 8f14a16
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions addons/knobs/src/components/PropForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@ const stylesheet = {
};

export default class propForm extends React.Component {
constructor() {
super();
this._onFieldChange = this.onFieldChange.bind(this);
}

onFieldChange(name, type, value) {
const change = { name, type, value };
this.props.onFieldChange(change);
makeChangeHandler(name, type) {
return value => {
const change = { name, type, value };
this.props.onFieldChange(change);
};
}

render() {
Expand All @@ -36,8 +33,7 @@ export default class propForm extends React.Component {
return (
<form style={stylesheet.propForm}>
{knobs.map(knob => {
// eslint-disable-next-line react/jsx-no-bind
const changeHandler = this.onFieldChange.bind(this, knob.name, knob.type);
const changeHandler = this.makeChangeHandler(knob.name, knob.type);
return (
<PropField
key={knob.name}
Expand Down

0 comments on commit 8f14a16

Please sign in to comment.