Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chris-kobrzak/eef62301d4d6634098d728cc72b08485 to your computer and use it in GitHub Desktop.
Save chris-kobrzak/eef62301d4d6634098d728cc72b08485 to your computer and use it in GitHub Desktop.
Code sample with only ES6 modules transpiled by Babel
class TextInputControl extends _react2.default.Component {
constructor(props) {
super(props);
this.bindInstanceMethods('handleBlurEvent', 'handleChangeEvent');
this.handleChangeEventDebounced = (0, _debounce2.default)(this.handleChangeEvent, props.inputChangeDebounceWait);
}
bindInstanceMethods(...methods) {
methods.forEach(method => this[method] = this[method].bind(this));
}
render() {
let props = this.props;
let secondaryLabel;
if (props.secondaryLabel) {
secondaryLabel = this.getLabel(props.secondaryLabel, props.secondaryLabelClass);
}
/* more code here... */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment