final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.38k stars 480 forks source link

Field Conditional rendering for multiple inner Fields break #860

Open gadiGuesty opened 4 years ago

gadiGuesty commented 4 years ago

Are you submitting a bug report or a feature request?

Possibly a bug

What is the current behavior?

Field children render prop, returning two or more inner Fields (conditional rendering) behaves unexpectedly in the ui and does not subscribe to corresponding names

What is the expected behavior?

Conditional Field should render and subscribe correct fields

Sandbox Link

https://codesandbox.io/s/react-final-form-conditional-fields-forked-dze46?file=/src/index.js

https://codesandbox.io/s/react-final-form-conditional-fields-forked-dze46?file=/src/index.js

What's your environment?

node: 12.18.3 OS: mac browser: chrome

 "react-final-form": "^6.3.5",
  "final-form": "^4.18.7",
   "react": "^16.13.0",

Other information

I have seen the docs example for conditional rendering but still this is a weird bug

bluSCALE4 commented 3 years ago

Not a bug. You're rendering a list of things without unique keys. The virtual dom don't know what to update.

https://reactjs.org/docs/lists-and-keys.html

This should be closed.

gadiGuesty commented 3 years ago

@bluSCALE4 tnx...