final-form / final-form/react-final-form-arrays
Incorrect typings for FieldArray.initialValues
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 69
- 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?
I got an error when pass initialValues as an array
```
interface MyType {
name: string;
}
...
name="test" initialValue={[{name: ''}]}>
```
Error:
Type: MyType[] has no properties in common with type MyType;
### What is the expected behavior?
Compiling without errors
### Sandbox Link
### What's your environment?
"final-form": "^4.18.2",
"final-form-arrays": "^1.1.2",
"react-final-form": "^6.3.0",
"react-final-form-arrays": "^3.1.1",
### Other information
I assume it can be solved by changing
```
export interface UseFieldArrayConfig
extends UseFieldConfig {
isEqual?: (a: any[], b: any[]) => boolean
}
```
to
```
export interface UseFieldArrayConfig
extends UseFieldConfig {
isEqual?: (a: any[], b: any[]) => boolean
}
```
Contributor guide
Assessment
This issue has not been assessed yet.