Closed CripyIce closed 9 months ago
Hmm so the reason this happens is because in order to preserve your types and values instead of just values i JSON.stringify() each value so that later on on the server I can preserve numbers and booleans and so on. This is in line with what I was doing before v3 where I just JSON.stringified an object and sent it over the line instead. I think I can create a flag that allows you to either stringify everything or not based on your preference
As of the current version, how should I parse the values correctly?
parseFormData utility will return it to you properly, until I figure out a way to let you choose your use case, otherwise if you need something more custom you can either use your own submitter, something like: onValid: data => submit(...your way to submit...) or you can just JSON.parse() every field on the backend
Well, JSON.parse()
did help for now.
If I will be able to configure this behavior with a flag it would be nice!
Thanks!
@CripyIce I released a new release that lets you pass a prop into useForm that allows you to either stringify strings as well or send them as is!
Since
3.2.0
all of my forms that hassubmitData
passes strings with quotes. Example:Downgrading to version
3.1.0
make it work as it should: