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
Although the explanation makes sense by calling out that handleSubmit needs to be bound to a button press and not a form submission it shows an example of onPress={handleSubmit}
Which is not technically correct.
RN's OnPressEvent is a GestureResponderEvent while handleSubmit expects a FormEvent
Expected behavior
handleSubmit expects a form event and does only 2 things with this event:
Bug report
This is not a bug but rather a mis-documentation.
Current Behavior
The following docs explain how to use formik with RN
Although the explanation makes sense by calling out that
handleSubmit
needs to be bound to a button press and not a form submission it shows an example ofonPress={handleSubmit}
Which is not technically correct.
RN's OnPressEvent is a
GestureResponderEvent
while handleSubmit expects aFormEvent
Expected behavior
handleSubmit
expects a form event and does only 2 things with this event:After those 2 are complete the event is not needed.
Since those are not relevant in a React Native context then I propse we change the documentation for React-Native to prompt users to use it as such:
This doesn't require any changes to the handleSubmit function such as the patch solution proposed here #3233 (comment)
Neither the non type safe solutions mentioned in a few other issues such as:
#3690
#3646
#3233
Reproducible example
Suggested solution(s)
Update the docs to indicate that react native users should not be passing in onPress events into the
handleSubmit
methodAdditional context
#3690
#3646
#3233
The text was updated successfully, but these errors were encountered: