Skip to content

Commit

Permalink
fix method binding
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemmarsh committed Nov 28, 2015
1 parent 5dea7e2 commit 17b2ede
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class App extends React.Component {

constructor(props) {
super(props);

this.onUserChange = this.onUserChange.bind(this);

this.state = {
currentUser: {}
};
Expand Down
5 changes: 4 additions & 1 deletion app/js/pages/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class SearchPage extends React.Component {

constructor(props) {
super(props);

this.handleQueryChange = this.handleQueryChange.bind(this);

this.state = {
query: ''
};
Expand All @@ -33,7 +36,7 @@ class SearchPage extends React.Component {

<h2>Your query: <span ref="queryDisplay">{this.state.query}</span></h2>

<input type="text" onChange={this.handleQueryChange.bind(this)} ref="searchInput" />
<input type="text" onChange={this.handleQueryChange} ref="searchInput" />
</div>

<div>
Expand Down

0 comments on commit 17b2ede

Please sign in to comment.