Skip to content

Commit

Permalink
Merge pull request #14 from iamkevinlowe/function-bind-fixes
Browse files Browse the repository at this point in the history
Added context binding to component function calls
  • Loading branch information
bdougie committed Apr 2, 2016
2 parents a3ddcea + 9bd0bcd commit 12339af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions App/Components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export default class Login extends React.Component {
}

render() {
const _handleSubmit = this.handleSubmit;
const _handleEmailChange = this.handleEmailChange;
const _handlePasswordChange = this.handlePasswordChange;
const _handleSubmit = this.handleSubmit.bind(this);
const _handleEmailChange = this.handleEmailChange.bind(this);
const _handlePasswordChange = this.handlePasswordChange.bind(this);
const showErr = (
this.state.error ? <Text> {this.state.error} </Text> : <View />
);
Expand Down
2 changes: 1 addition & 1 deletion App/Components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Settings extends React.Component {
}

render() {
const _logout = this.logOut;
const _logout = this.logOut.bind(this);

return (
<View style={styles.container}>
Expand Down

0 comments on commit 12339af

Please sign in to comment.