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

Rerender Field component with value from previous input

Open
#724 0 comments 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 behavior?

When changing rendered Field, form render child with value from previous state.
![Screenshot 2020-01-24 at 14 05 37](https://user-images.githubusercontent.com/39924834/73071361-d234d500-3eb2-11ea-9681-58443b30a189.png)

**Step to reproduce**
1. Click button 'Pass array to notQuery'.
2. Click button 'Press me to change query'.
3. In console we can see two renders as form changes input.name first and than input.value in secound step, forcing 2 renders.

### What is the expected behavior?

Form render child once with new value.

### Sandbox Link

https://codesandbox.io/s/react-example-g4i2g

### What's your environment?
"react-final-form": "^6.3.5",
"react": "^16.9.0",
"react-dom": "^16.9.0"

### Other information
none

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.