mobx-react-form icon indicating copy to clipboard operation
mobx-react-form copied to clipboard

moment __proto__ disappear

Open dyf2015 opened this issue 7 years ago • 2 comments

When I use the momentjs field and call form.update, the proto for the moment field is missing.

dyf2015 avatar Dec 17 '17 13:12 dyf2015

Please provide a codesandbox with logging/debug. Thank you.

foxhound87 avatar Dec 28 '17 11:12 foxhound87

I'm running into the same issue as this (and probably this), since I'm trying to use the MUI DatePicker component, which outputs a Moment or other library-specific date object, rather than a string.

Here's an example without MUI: https://codesandbox.io/s/form-quickstart-forked-35hj6i

Initially it logs the default value I provided when creating the form, which has a Moment prototype. If you click the Update button, I'm calling form.update and passing it a new Moment object. But after the bind method is called again, the resulting value that gets logged no longer has a Moment prototype.

(I'm not displaying any form fields here, to simplify things.)

jacobweberbowery avatar Oct 20 '22 17:10 jacobweberbowery