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

Keep consistency in example, TL;DR use id as key instead of name

Open brikou opened this issue 6 years ago • 2 comments

Are you submitting a bug report or a feature request?

I'd like to have an example using id as key instead of name, to prevent an error to display close to the wrong field for instance.

What is the current behavior?

The basic array example is working fine because there is no validation, but if we add validation to this form, it would be buggy as we use "name" as key prop in the loop.

What is the expected behavior?

We should probaly add a more real worl example with validation and then use a generated id (like Math.random.toString())

Sandbox Link

What's your environment?

Other information

Thank you @erikras

brikou avatar Jan 13 '18 09:01 brikou

@erikras Is it possible to use id instead of index or name at this moment ? Because of this problem, we can't add enter/exit animation on proper Field.

Here is the example using react-pose below. Whichever you remove, the fade out animation always happens on very bottom of the items. https://codesandbox.io/s/m42oxprp8j

taneba avatar Oct 30 '18 08:10 taneba

Another issue is usage with something like react-tables. The table can be re-sorted, filtered and it's very hard to support the indexes.

pinguinjkeke avatar Jun 21 '19 09:06 pinguinjkeke