Skip to content
New issue

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandle error on handleSubmit function #3921

Open
daniel18acevedo opened this issue Nov 29, 2023 · 1 comment
Open

Unhandle error on handleSubmit function #3921

daniel18acevedo opened this issue Nov 29, 2023 · 1 comment

Comments

@daniel18acevedo
Copy link

Bug report

Current Behavior

When handleSubmit from useFormikContext gets executed by a button on a onPress function, if the function passed to onSubmit prop on the Formik component throws an error, the error never climbs up to the handleSubmit function. It displays UnhandledError

Expected behavior

Errors thrown in onSubmit function should be thrown by handleSubmit function as well

Reproducible example

https://codesandbox.io/p/sandbox/formik-codesandbox-template-forked-ctwkhg?file=%2Findex.js%3A17%2C16

Suggested solution(s)

Let the Error clim to how executes handleSubmit

Your environment

Software Version(s)
Formik 2.4.3
React 18.2.0
TypeScript 5.1.6
Browser Chrome
npm/Yarn 8.1.2
Operating System Windows
@abhishekmmgn
Copy link

I've worked with Formik before and would like to work on this issue. Kindly assign this task to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants