Skip to content

Commit

Permalink
Merge pull request #24 from jakemmarsh/fix-set-state
Browse files Browse the repository at this point in the history
fix method binding
  • Loading branch information
jakemmarsh committed Nov 28, 2015
2 parents 5dea7e2 + 37a6a9b commit d1334f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-rocket-boilerplate",
"version": "2.1.0",
"version": "2.1.1",
"author": "Jake Marsh <[email protected]>",
"description": "Boilerplate using React, Browserify, SASS, and Gulp.",
"repository": {
Expand Down

0 comments on commit d1334f1

Please sign in to comment.