Is Netlify able to receive nested values on Forms feature? [react-dates with Formik]

泪湿孤枕 提交于 2019-12-13 02:48:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!