prestojs / prestojs

https://prestojs.com/
6 stars 1 forks source link

Form initialValues type #172

Closed davecoates closed 1 year ago

davecoates commented 2 years ago

Currently it's

initialValues?: FormValues | ViewModelInterface<any, any>;

and has this logic:

if (isViewModelInstance(initialValues)) {
        initialValues = initialValues.serializeToForm();
    }

... but serializerToForm isn't a function on view model

And initialValues should accept Partial<FormValues>

I think just remove initialValues handling entirely from form and just do whatever final-form does and use it's types

davecoates commented 1 year ago

Fixed in d241ff8fc33e406e3660da999e37c8689f962e60