Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { connect } from 'react-redux';
- import { getTranslate } from 'react-localize-redux';
- function mapStateToProps(state) {
- return {
- t: getTranslate(state.locale)
- };
- }
- export default connect(
- mapStateToProps
- )(
- ({ t }) => ({
- e001: t('wrong_format'),
- e002: t('invalid_email'),
- })
- );
- import React, { Component } from 'react';
- import { connect } from 'react-redux';
- import { getTranslate } from 'react-localize-redux';
- import { Field, reduxForm } from 'redux-form';
- import Error from './Error';
- const validate = (values) => {
- console.log('error: ', Error);
- // Process validate redux-form with messages from Error.js
- };
- class SignIn extends Component {
- // Process login form with redux-form
- }
- function mapStateToProps(state) {
- return {
- t: getTranslate(state.locale),
- };
- }
- const SignInForm = {
- form: 'SignIn',
- validate,
- };
- export default connect(
- mapStateToProps
- )(
- reduxForm(SignInForm)(
- SignIn
- )
- );
Add Comment
Please, Sign In to add comment