-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add support for empty
in Reference fields
#10817
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
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.
It's nice that we have more base components! 💯 That would be even nicer with stories and tests for those :)
Done is better than perfect ;) The base components are tested indirectly via MUI components. |
Problem
When using Reference fields (
<ReferenceField>
,<ReferenceOneField>
,<ReferenceManyField>
), to define a custom view for the empty case, developers have to create a custom child that reads the list context. This is super cumbersome.Solution
Add support for the
empty
prop.Additional Checks
<ReferenceOneFieldBase>
from<ReferenceOneField>
<ReferenceManyFieldBase>
from<ReferenceManyField>
<ReferenceField empty>
prop<ReferenceArrayField empty>
prop<ReferenceManyField empty>
prop<WithRecord empty>
propThe
empty
logic is inra-core
, so it can be reused for other UI kits.The changes are backward compatible:
emptyText
is still supported where it was implemented, but it's deprecated.