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

TypeScript types for Mutators

Open pgross41 opened this issue 3 years ago • 1 comments

Are you submitting a bug report or a feature request?

Feature Request

What is the current behavior?

The keys are unknown on form.mutators. Unable to use IDE auto-complete to use mutators. Unable to benefit from TypeScript typing.

image

What is the expected behavior?

Expect the IDE to know what mutators are registered, in the sandbox example below they are printed out: insert, concat, move, etc.

Sandbox Link

Here is a very minimal example that doesn't do anything (had trouble converting the JS example to TS) but on line 9 you can type form.mutators. then Ctrl+Space and see the lack of suggestions.

https://codesandbox.io/s/awesome-dawn-tjqv0x?file=/src/index.tsx

What's your environment?

react-final-form v6.5.8

pgross41 avatar Mar 10 '22 17:03 pgross41

Please, this is the most requested feature for me.

I think we can use something like unistyles does with the internal theme type.

They simply have a style that we can override easily.

image

Docs: https://reactnativeunistyles.vercel.app/reference/theming/

douglasjunior avatar Dec 18 '23 11:12 douglasjunior