final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.39k stars 481 forks source link

Mapped type over FormProps is `{[string]: any}` since 6.5.2 #874

Open typeofweb opened 4 years ago

typeofweb commented 4 years ago

This commit https://github.com/final-form/react-final-form/issues/864 introduced a breaking change for TypeScript users because now mapped types over FormProps return a dictionary of any.

For example:

type FinalFormWrapperProps<
  FormValues extends object = Record<string, any>,
  InitialFormValues = Partial<FormValues>
> = Omit<FormProps<FormValues, InitialFormValues>, 'validate'>;

Result before this commit:

Screenshot 2020-11-06 at 16 23 55

After:

Screenshot 2020-11-06 at 16 24 34

TypeScript 4.0.3 final-form 4.20.1 react-final-form 6.5.2

CarsonF commented 3 years ago

Yeah same. I just upgraded and had to patch that line out.

Sparragus commented 2 years ago

Oh no. This really prevents a ton of important use cases. See https://stackoverflow.com/questions/70525203/omit-react-componentprops-and-react-final-forms-fieldprops-produce-an-unexpec

Can we go back to how things were? Is that an option?