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
Without extra setup, submitting a React form when hosted on Netlify will return a 404 error.
32
32
33
-
The error can be a bit misleading because, when you look at the code, the form is there. It should be found. So what's happening?!
33
+
This error can be a bit misleading because, when you look at the code, the form is there. It should be found. So what's happening?!
34
34
35
35
The reason is that Netlify's form-bots can't see JavaScript rendered form code. It's not that they're doing anything wrong, it's just kinda how things are. Thankfully, they're nice enough to have given us a way to work around this issue.
36
36
37
-
So in order to get this working, a bit of extra work needs to be done.
37
+
So in order to get this working, there's a few more steps to be done.
38
38
39
39
## Steps to Get Things Working
40
40
@@ -50,9 +50,9 @@ Add the following form block just below the initial `<body>` element tag in `/pu
50
50
</form>
51
51
```
52
52
53
-
I believe you can also just put this form as a separate HTML file somewhere in your build, and it will get picked up, but I haven't tried that yet.
53
+
According to the maesters, you can--rather than add this code block to `/public/index.html`--create a separate HTML file that includes your form code block somewhere in the build, and it will get picked up. I, haven't tried this, personally, but the maesters said it is so.
54
54
55
-
> :point_up: This is obviously just an example, so make sure that there is one-to-one match here, whereby each input corresponds with a respective input element/Field component in your Formik form.
55
+
> :point_up: This is obviously just an example. Your form will most likely have differing fields. So make sure that there is one-to-one match here, whereby each input corresponds with a respective input element/Field component in your Formik form.
56
56
57
57
### 2) Add additional `initial values` to the Formik form
0 commit comments