问题
I successfully set react-dates with Formik under Gatsbyjs.
Here you have a working demo: https://codesandbox.io/s/723l233my1
Now, my problem concerns netlify (or the way in which react-dates nest the values).
So depending on the problem I have two questions:
- Is Netlify able to receive nested objects on the Forms feature?
- Can I tell react-dates
to give me shallow values instead of nested objects?
In the working demo you can see that the values (startDate and endDate) seems shallow:
"values": {
"email": "jonsnow@gmail.com",
"name": "Jon Snow",
"startDate": "2019-04-18T10:00:00.000Z",
"endDate": "2019-04-25T10:00:00.000Z"
}
But, on the contrary date values are nested, so they don't actually appear on the ajax request that Netlify received.
This is an example of a form compiled that I receive on netlify:
Name
Jon Snow
Email
jonsnow@gmail.com
Start
End
Start and End are the "id"s specified on date-picker.js component (inside the working demo).
Is like netlify takes the "id" as the values (or does not receive the nested ones).
Thanks in advance for any help.
来源:https://stackoverflow.com/questions/55748153/is-netlify-able-to-receive-nested-values-on-forms-feature-react-dates-with-for