final-form / react-final-form

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

FormState generic type requires 1 type argument. #528

Open zalishchuk opened 5 years ago

zalishchuk commented 5 years ago

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

My application has some code like this:

onChange?: (formState: FormState) => void;

So, after FormState definition was updated to have FormValues generic type for values, I have this type of error: Generic type 'FormState<FormValues>' requires 1 type argument(s).

What is the expected behavior?

Make generic for FormState<FormValues> optional and set default value to AnyObject as it was before update.

export interface FormState<FormValues = AnyObject> {

What's your environment?

{
  "react": "^16.8.6",
  "react-dom": "^16.8.4",
  "react-final-form": "^6.1.0",
  "final-form": "^4.14.1",
}
Miicky commented 5 years ago

+1 ping

sntxerror commented 3 years ago

any updates?

designbyadrian commented 2 years ago

Please +1 the original post as it can be seen by moderators in their lists. +1:ing a comment won't do much in terms of exposure.