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

getIn always returns undefined

Open
#696 1 comment 1 reaction 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 behaviour?

The getIn function given with the tools provided to mutators always returns undefined.
I can't get it to work under any circonstances, complex or simple names, I've created a simpler version do demonstrate:

```
render() {
return (

{console.log(tools.getIn(state, name), state)}
}}
/>

);
}

renderForm = ({handleSubmit, submitting, form: { mutators: {testMutator}}}) => {
return (

...

{strings.precision_country_label}

testMutator('country')}>Test

...
)
}
```

The result of the log :

![Screenshot 2019-12-12 at 10 26 38](https://user-images.githubusercontent.com/32204131/70699897-2486b180-1cca-11ea-8562-fc433e994612.png)

### What is the expected behavior?

It should return the value of the field that I request with the complexKey param.
I've also logged the state param, and the field does exist with its value

### Sandbox Link

### What's your environment?

"react-final-form": "^6.3.3",
"react-final-form-arrays": "^3.1.1",
"final-form": "^4.18.6",
"final-form-arrays": "^3.0.2",
"react": "^16.9.0",
"react-dom": "^16.9.0",

I've only tested with Chrome (78.0.3904.108) on Mac

### Other information

Thank you for your time, and this excellent package that I love!

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.