We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
About 1 or 2 seconds after validation fails a promise is rejected with the errors object.
Possible Unhandled Promise Rejection (id: 0): Object { "test": "test is a required field", }
I'd expect no unhandled promise rejections.
Steps to reproduce:
npm install -g expo-cli expo init formik-yup-test cd formik-yup-test yarn add formik yup
Copy this code into App.js
import { Button, StyleSheet, Text, TextInput, View } from 'react-native'; import { Formik } from 'formik'; import * as Yup from 'yup'; import React from 'react'; const schema = Yup.object().shape({ test: Yup.string().required(), }); export default function App() { return ( <View style={styles.container}> <Formik initialValues={{ test: '' }} onSubmit={values => console.log(values)} validationSchema={schema}> {({ errors, handleChange, handleBlur, handleSubmit, values }) => ( <> <TextInput onBlur={handleBlur('test')} onChangeText={handleChange('test')} style={styles.textInput} value={values.test} /> <Text style={styles.errors}>{JSON.stringify(errors)}</Text> <Button onPress={handleSubmit} title="Submit" /> </> )} </Formik> </View> ); } const styles = StyleSheet.create({ errors: { textAlign: 'center', }, textInput: { alignSelf: 'stretch', borderColor: 'black', borderWidth: 1, fontSize: 20, marginBottom: 10, }, container: { flex: 1, backgroundColor: '#fff', padding: 20, }, });
Run yarn start and open in the iOS Simulator.
yarn start
Avoid rejecting promises or document how the user can avoid this warning. The example form was based on the documentation here https://jaredpalmer.com/formik/docs/guides/react-native
The text was updated successfully, but these errors were encountered:
this is caused by combineErrors and has been rolled back in 2.0.8 hotfix
Sorry, something went wrong.
Fixed in 2.1
I have this in yup@1.2.0
No branches or pull requests
馃悰 Bug report
Current behavior
About 1 or 2 seconds after validation fails a promise is rejected with the errors object.
Expected behavior
I'd expect no unhandled promise rejections.
Reproducible example
Steps to reproduce:
npm install -g expo-cli expo init formik-yup-test cd formik-yup-test yarn add formik yup
Copy this code into App.js
Run
yarn start
and open in the iOS Simulator.Suggested solution(s)
Avoid rejecting promises or document how the user can avoid this warning. The example form was based on the documentation here https://jaredpalmer.com/formik/docs/guides/react-native
Your environment
The text was updated successfully, but these errors were encountered: