react-final-form icon indicating copy to clipboard operation
react-final-form copied to clipboard

Field Conditional rendering for multiple inner Fields break

Open gadiGuesty opened this issue 4 years ago • 2 comments

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

gadiGuesty avatar Sep 23 '20 14:09 gadiGuesty

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.

bluSCALE4 avatar Sep 22 '21 16:09 bluSCALE4

@bluSCALE4 tnx...

gadiGuesty avatar Sep 22 '21 17:09 gadiGuesty