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

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

Open typeofweb opened this issue 4 years ago • 2 comments

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

typeofweb avatar Nov 06 '20 15:11 typeofweb

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

CarsonF avatar Apr 03 '21 19:04 CarsonF

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?

Sparragus avatar Dec 29 '21 21:12 Sparragus