Skip to content
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

Add ability to use record from context in Field components #5995

Merged
merged 5 commits into from
Mar 4, 2021

Conversation

fzaninotto
Copy link
Member

The record prop injection in fields is magical, and a source of incomprehension for react-admin learners. Why do <TextField source="title" /> work as a <Datagrid> child, but not in a custom Show layout?

We've recently introduced the RecordContext. It's time we enable support for this context in Field components, to remove the incomprehension.

This change is totally backwards compatible. It also prepares v4, where we'll remove the record prop injection.

@fzaninotto fzaninotto added the RFR Ready For Review label Mar 4, 2021
@fzaninotto
Copy link
Member Author

Back to WIP: I forgot to set the correct record in Reference fields

@fzaninotto fzaninotto added WIP Work In Progress and removed RFR Ready For Review labels Mar 4, 2021
@fzaninotto fzaninotto added RFR Ready For Review and removed WIP Work In Progress labels Mar 4, 2021
@fzaninotto
Copy link
Member Author

And back to RFR

@djhi djhi added this to the 3.14 milestone Mar 4, 2021
@djhi djhi merged commit 048d211 into next Mar 4, 2021
@djhi djhi deleted the userecordcontext-in-fields branch March 4, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants