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

Bug: Cannot use createForm() instance with <Form/> normally

Open
#910 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

After creating a form with `createForm()`:

```ts

type FormValues = {
name: string;
};

const initialValues: FormValues = {
name: 'Foo',
};

const form = createForm({
initialValues: initialValues,
onSubmit: submitForm,
}),
```

I cannot use it in a normal way in: ``.

```ts
return (

)

Instead TypeScript starts complaining about wrong `onSubmit`:
```
TS2741: Property 'onSubmit' is missing in type '{ form: FormApi>; render: ({ handleSubmit, form, submitting, pristine, values }: FormRenderProps>) => Element; }' but required in type 'FormProps>'.
```

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.