final-form / final-form/react-final-form

TypeScript types for Mutators

Open
#978 1 comment 8 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### 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](https://user-images.githubusercontent.com/11710621/157722830-160cfd84-80d9-427a-9dd8-e2ddf1bd6aa9.png)

### 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](https://codesandbox.io/s/kx8qv67nk5) 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.