You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you were expecting:
When the <List empty={}> component is empty, the list should display the empty component.
What happened instead:
The provided empty component is not displayed when the list is empty, Took me a while to figure it out, it's related to checking the hasCreate state
Steps to reproduce:
Simply pass a custom component <List empty={<CustomComponent />}> to an empty list that doesn't have hasCreate=true
Seem like it's a bug related to the assumption that hasCreate needs to be true to display the empty component. The empty component should be displayed for any empty Lists regardless of the hasCreate status. One of our resources doesn't allow creation but we would still like to display custom empty components
Related code:
Should be an easy fix: (remove hasCreate check)
What you were expecting:
When the
<List empty={}>
component is empty, the list should display the empty component.What happened instead:
The provided empty component is not displayed when the list is empty, Took me a while to figure it out, it's related to checking the
hasCreate
stateSteps to reproduce:
Simply pass a custom component
<List empty={<CustomComponent />}>
to an empty list that doesn't havehasCreate=true
Seem like it's a bug related to the assumption that
hasCreate
needs to be true to display the empty component. The empty component should be displayed for any empty Lists regardless of thehasCreate
status. One of our resources doesn't allow creation but we would still like to display custom empty componentsRelated code:
Should be an easy fix: (remove
hasCreate
check)react-admin/packages/ra-ui-materialui/src/list/ListView.tsx
Line 91 in 12a40fb
Environment
Thanks for a great framework guys!
The text was updated successfully, but these errors were encountered: