Created
April 12, 2016 20:52
-
-
Save wordyallen/8376d99e118be34eeb4228764aec52bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mapDispatchToProps= (dispatch) => ({attemptLogin(){ | |
dispatch(actions.attemptLogin()) | |
}}) | |
const Login = React.createClass({ | |
contextTypes: { | |
router: React.PropTypes.object.isRequired | |
}, | |
handleSubmit(){ | |
const {attemptLogin} = this.props | |
if(attemptLogin()){ | |
this.context.router.replace('entries') | |
} | |
}, | |
render (){ | |
return( | |
<a className="button is-large is-primary control" onClick={this.handleSubmit}> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment