Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LoginForm extends React.Component {
- render() {
- const email = React.findDOMNode(this.refs.email);
- return (
- <div>
- <Form horizontal>
- <FormGroup controlId="formHorizontalEmail">
- <Col componentClass={ControlLabel}>Email</Col>
- <Col><FormControl type="email" ref="email"/></Col>
- </FormGroup>
- <FormGroup>
- <Col>
- <Button type="submit" block>Sign in</Button>
- </Col>
- </FormGroup>
- </Form>
- <Button onClick={() => this.props.doLogin(email, 'password')}>Login</Button>
- </div>
- )
- }
- }
- /**
- * Connect staff.
- */
- const mapStateToProps = (state) => {
- return {
- ...
- };
- };
- const mapDispatchToProps = (dispatch) => {
- return {
- doLogin: (email, password) => dispatch(performLogin(email, password))
- };
- };
- export default connect(mapStateToProps, mapDispatchToProps)(LoginForm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement