I like to set the IsRowExpandable property to false, if no entries for the ReferenceManyField exists. How can i access the ReferenceManyField count or rows? I found a similar question, but i have no idea how can i access this total prop in this context. (Get ReferenceManyField Count?)
https://marmelab.com/react-admin/List.html#isrowexpandable
const ExpandCardWithDatagrid = () => {
const classes = useStyles();
return (
<Card className={classes.subcard} variant="outlined">
<CardContent>
<ReferenceManyField reference="comments" target="postId">
<Datagrid rowClick="edit">
<NumberField source="myField1" />
<NumberField source="myField2" />
...
</Datagrid>
</ReferenceManyField>
</CardContent>
<CardActions>
<ViewFilteredContractTypesList />
</CardActions>
</Card>
)
}
...
<List
{...props}
bulkActionButtons={false}/>}
>
<Datagrid
rowClick="edit"
isRowExpandable={??????????}
expand={<ExpandCardWithDatagrid />}>
...