Skip to content

Commit

Permalink
refactor(SearchBox): inline input ref
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Feb 7, 2019
1 parent f2d2780 commit 074877c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/SearchBox/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,6 @@ class SearchBox extends Component {
this.setState({ query: '' });
}

onInputRef = input => {
this.input = input;

if (this.props.autofocus) {
this.input.focus();
}
};

onChange = event => {
const { searchAsYouType, refine, onChange } = this.props;
const query = event.target.value;
Expand Down Expand Up @@ -151,7 +143,7 @@ class SearchBox extends Component {
onReset={this.onReset}
>
<input
ref={this.onInputRef}
ref={inputRef => (this.input = inputRef)}
value={query}
disabled={this.props.disabled}
className={cssClasses.input}
Expand Down

0 comments on commit 074877c

Please sign in to comment.