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

InitialFormValues dosen't bridge to FormApi

Open
#997 0 comments 0 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**?

bug report

### What is the current behavior?

```ts
type Data = {
user: {
name: string;
email: string;
};
};

type RecursivePartial = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial[]
: T[P] extends object
? RecursivePartial
: T[P];
};

> onSubmit={onSubmit}>
{({ handleSubmit, form }) => {
useEffect(() => {
form.initialize({
user: {
name: "aaa"
}
});
}, [form]);
return (




);
}}

```

`form.initialize` values type is `Partial`.

### What is the expected behavior?

`form.initialize` values type should be `RecursivePartial`.

### Sandbox Link

https://codesandbox.io/s/laughing-sound-fk5rz4?file=/src/Form.tsx

### What's your environment?

```
"final-form": "4.20.7",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-final-form": "6.5.9",
```

### Other information

nothing.

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.