File tree 1 file changed +9
-3
lines changed
packages/ra-ui-materialui/src/list
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export const SingleFieldList = (props: SingleFieldListProps) => {
70
70
71
71
return (
72
72
< Component className = { className } { ...sanitizeListRestProps ( rest ) } >
73
- { data . map ( record => {
73
+ { data . map ( ( record , rowIndex ) => {
74
74
const resourceLinkPath = ! linkType
75
75
? false
76
76
: createPath ( {
@@ -81,7 +81,10 @@ export const SingleFieldList = (props: SingleFieldListProps) => {
81
81
82
82
if ( resourceLinkPath ) {
83
83
return (
84
- < RecordContextProvider value = { record } key = { record . id } >
84
+ < RecordContextProvider
85
+ value = { record }
86
+ key = { record . id ?? `row${ rowIndex } ` }
87
+ >
85
88
< Link
86
89
className = { SingleFieldListClasses . link }
87
90
to = { resourceLinkPath }
@@ -99,7 +102,10 @@ export const SingleFieldList = (props: SingleFieldListProps) => {
99
102
}
100
103
101
104
return (
102
- < RecordContextProvider value = { record } key = { record . id } >
105
+ < RecordContextProvider
106
+ value = { record }
107
+ key = { record . id ?? `row${ rowIndex } ` }
108
+ >
103
109
{ children }
104
110
</ RecordContextProvider >
105
111
) ;
You can’t perform that action at this time.
0 commit comments