esbenp / esbenp/react-native-redux-form-example
Not hitting dispatching submit function
- Dominant language
- JavaScript
- Stars
- 22
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
So i have copied your example and linked it up to an api endpoint which should error due to not being authenticated but its not seeming to get to the action.
`import { submitForm } from '../../reducers/audits';
const onSubmit = (values) => {
console.warn(values);
submitForm(values);
};
const countryOptions = [
{ label: 'Denmark', value: 'DK' },
{ label: 'Germany', value: 'DE' },
{ label: 'United State', value: 'US' },
];
class Audit extends Component {
render() {
const { handleSubmit, submitting } = this.props;
return (
Save
);
}
}
export default reduxForm({
form: 'Form',
validate: (values) => {
const errors = {};
if (!values.first_name) {
errors.first_name = 'First name is required.';
}
if (!values.last_name) {
errors.last_name = 'Last name is required.';
}
if (!values.email) {
errors.email = 'Email is required.';
}
return errors;
},
})(Audit);`
this is all my code im not sure where im going wrong as that console warn will warn me with the object with my field values in it but some reason it wont hit the submitForm from my reducer.
I am new to react-native I am normally a reactjs dev
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.