From 7f27ae414d35c99a4f1e540584a8a872fd0debc5 Mon Sep 17 00:00:00 2001 From: Alex Johansson Date: Mon, 4 Jan 2021 17:33:58 +0100 Subject: [PATCH] Allow explicitly setting action to empty string (#2981) If someone actually wants to do a standard http post to the same page. --- packages/formik/src/Form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/formik/src/Form.tsx b/packages/formik/src/Form.tsx index 93ffe65e3..fea573283 100644 --- a/packages/formik/src/Form.tsx +++ b/packages/formik/src/Form.tsx @@ -17,7 +17,7 @@ export const Form = React.forwardRef( // iOS needs an "action" attribute for nice input: https://stackoverflow.com/a/39485162/406725 // We default the action to "#" in case the preventDefault fails (just updates the URL hash) const { action, ...rest } = props; - const _action = action || '#'; + const _action = action ?? '#'; const { handleReset, handleSubmit } = useFormikContext(); return (