Closed smeng9 closed 2 years ago
What you were expecting:
Using an ArrayField + SingleFieldListfor embedded data that doesn't have an id prop should work without console errors
What happened instead:
I get this error in the console: Warning: Each child in a list should have a unique "key" prop.
Warning: Each child in a list should have a unique "key" prop.
Steps to reproduce:
Related code:
https://codesandbox.io/s/stoic-glade-hs0dpi?file=/src/posts/PostShow.tsx:1269-1446
Other information:
This is where the key is set based on the id, which doesn't exist in this case:
https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/list/SingleFieldList.tsx#L102
Environment
Duplicate of https://github.com/marmelab/react-admin/issues/7541
The fix should be similar to https://github.com/marmelab/react-admin/pull/7548 and just one or two lines
What you were expecting:
Using an ArrayField + SingleFieldListfor embedded data that doesn't have an id prop should work without console errors
What happened instead:
I get this error in the console:
Warning: Each child in a list should have a unique "key" prop.
Steps to reproduce:
Related code:
Other information:
This is where the key is set based on the id, which doesn't exist in this case:
https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/list/SingleFieldList.tsx#L102
Environment