You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking forward to using this. Ran into an issue though. If I have a simple render function with just a it shows the label with text. Anything I put within
and I end up with a blank view.
Code
importReact,{Component}from'react';importPropTypesfrom'prop-types';import{Text,TouchableOpacity}from'react-native';import{reduxForm,Field}from'redux-form/immutable';import*asregexpfrom'../inputs/regexp.constants';import*asformStatesfrom'../forms.constants';importstylesfrom'./login.styles';import{authenticate}from'../../../states/auth/auth.actions';import{connect}from'react-redux';import{bindRoutineCreators}from'redux-saga-routines';import{Button,Form,FieldsContainer,Fieldset,ActionsContainer}from'react-native-clean-form'import{Input}from'react-native-clean-form/redux-form-immutable';classLoginFormextendsComponent{constructor(props){super(props);this.onSubmit=this.onSubmit.bind(this);}onSubmit(){const{handleSubmit, authenticate}=this.props;//handleSubmit(authenticate).then(this.props.authenticate().trigger().then(function(result){console.warn(JSON.stringify(result));},function(error){console.error(JSON.stringify(error));})}render(){const{handleSubmit, authenticate, submitting}=this.props;return(<Form><FieldsContainer><Fieldsetlabel="Login"><Inputname="email"label="Email"autoCapitalize="none"autoCorrect={false}spellCheck={false}autoFocus={true}keyboardType="email-address"returnKeyType="next"placeholder="Enter Your Email Address"/><Inputname="password"label="Password"autoCapitalize="none"autoCorrect={false}spellCheck={false}keyboardType="default"returnKeyType="done"secureTextEntry={true}placeholder="Enter Password"/></Fieldset></FieldsContainer><ActionsContainer><Buttonicon="md-checkmark"iconPlacement="left"onPress={handleSubmit(authenticate)}submitting={submitting}>
Login
</Button></ActionsContainer></Form>);}}constvalidate=values=>{consterrors={};values=values.toJS();errors.email=!values.email
? 'Email field is required'
: !regexp.EMAIL.test(values.email)
? 'Email format is invalid'
: undefined;errors.password=!values.password
? 'Password field is required'
: values.password.length<6
? 'Password must be at least 6 characters long'
: undefined;returnerrors;};LoginForm.propTypes={//onSubmit: PropTypes.func.isRequired, // redux-form included};functionmapStateToProps(state){return{//initialValues: state.get('auth').get('loginInfo'),};}functionmapDispatchToProps(dispatch){return{
...bindRoutineCreators({authenticate},dispatch),};}LoginForm=reduxForm({form: 'login',validate: validate})(LoginForm);exportdefaultconnect(mapStateToProps,mapDispatchToProps)(LoginForm);
Any ideas?
The text was updated successfully, but these errors were encountered:
Looking forward to using this. Ran into an issue though. If I have a simple render function with just a it shows the label with text. Anything I put within
and I end up with a blank view.Code
Any ideas?
The text was updated successfully, but these errors were encountered: