Last active
June 15, 2017 23:19
-
-
Save islahul/73f99302a721a714c002 to your computer and use it in GitHub Desktop.
React double colon meaning JSX usage
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
import './login.styl'; | |
import Component from '../components/component.react'; | |
import React from 'react'; | |
import exposeRouter from '../components/exposerouter.react'; | |
import {focusInvalidField} from '../lib/validation'; | |
@exposeRouter | |
export default class Login extends Component { | |
static propTypes = { | |
// Something here | |
}; | |
onFormSubmit(e) { | |
e.preventDefault(); | |
const {actions: {auth}, auth: {form}} = this.props; | |
// Something here | |
} | |
redirectAfterLogin() { | |
} | |
render() { | |
const { | |
actions: {auth: actions}, | |
auth: {form}, | |
msg: {auth: {form: msg}} | |
} = this.props; | |
return ( | |
<div className="login"> | |
// This is binding the function onFormSubmit to this fn.bind(this) | |
<form onSubmit={::this.onFormSubmit}> | |
</form> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you for this