-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<DatagridBody>
creates the <RecordContext>
instead of <DatagridRow>
#9808
<DatagridBody>
creates the <RecordContext>
instead of <DatagridRow>
#9808
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to remove the reconrdContextProvider from the DatagridRow
Done, I pushed in a hurry |
…text-instead-of-datagrid-row
docs/Upgrade.md
Outdated
+ {data.map((record, rowIndex) => ( | ||
+ <RecordContextProvider | ||
+ value={record} | ||
+ key={record.id ?? `row${rowIndex}`} | ||
+ > | ||
+ {cloneElement( | ||
row, | ||
{ | ||
//... | ||
id: record.id ?? `row${rowIndex}`, | ||
- key: record.id ?? `row${rowIndex}`, | ||
onToggleItem, | ||
- record, | ||
resource, | ||
//... | ||
}, | ||
children | ||
- ) | ||
)} | ||
+ </RecordContextProvider> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong diff: you should show how a custom DatagridRow no longer reads the record from its props, but from the Recordcontext.
This PR attempts to delegate the creation of a
<RecordContext>
to<DatagridBody>
instead of<DatagridRow>