Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handleSubmit = (event) => {
- event.preventDefault();
- const form = this.state.signInForm.fields;
- const params = {
- email: form.email.value,
- password: form.password.value,
- };
- this.props.onSignIn(params);
- }
- /**
- * Mapping dispatched functions to component's properties
- * @param {Object} dispatch Application dispatch function
- * @return {Object} Mapped functions
- */
- const mapDispatchToProps = dispatch => ({
- onSignIn: user => dispatch(signIn(user)),
- });
- /**
- * Mapping application state to component's properties
- * @param {Object} state Application state
- * @return {Object} Mapped properties
- */
- const mapStateToProps = state => ({
- signInErrors: state.authorization.signInErrors,
- });
- export default connect(mapStateToProps, mapDispatchToProps)(SignIn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement