-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
Description
I am trying to utilize the getResponse API. In a real world scenario, I want to submit a Formik form. In the submit handler I want to first challenge the user and when ready, continue with the rest of the submission - an API call to the backend containing the token. This approach does not work, as setFieldValue and submit are called in the same render cycle and submit still has the old state at the moment of execution.
I have created a codesandbox isolating the issue:
https://codesandbox.io/s/reaptcha-getresponse-returns-empty-string-zj4754?file=/src/App.tsx
Reactions are currently unavailable