Skip to content

Add ReferenceManyCountBase#10808

Merged
djhi merged 2 commits intonextfrom
referencemanycountbase
Jun 28, 2025
Merged

Add ReferenceManyCountBase#10808
djhi merged 2 commits intonextfrom
referencemanycountbase

Conversation

@fzaninotto
Copy link
Member

The current ReferenceManyCount component is tied to MUI. To reuse the same (simple) logic in other UI kits, I moved that logic to ra-core.

<ReferenceManyCountBase reference="comments" target="post_id" />

The current ReferenceManyCount component is tied to MUI. To reuse the same (simple) logic in other UI kits, I moved that logic to `ra-core`.

```jsx
<ReferenceManyCountBase reference="comments" target="post_id" />
```
<ErrorIcon color="error" fontSize="small" titleAccess="error" />
) : (
total
const body = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just put it inside the main JSX directly? This body const is useless now IMO

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's used twice

page = 1,
pagination = null,
perPage = 25,
record,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint warning now

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

>,
} = props;
const notify = useNotify();
const record = useRecordContext(props);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done by callers of the hook. This logic should better be in ra-core.

target,
queryOptions,
} = props;
const record = useRecordContext(props);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer necessary since the controller hook does it.

<ErrorIcon color="error" fontSize="small" titleAccess="error" />
) : (
total
const body = (
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's used twice

@djhi djhi added this to the 5.10.0 milestone Jun 28, 2025
@djhi djhi merged commit 437af04 into next Jun 28, 2025
15 checks passed
@djhi djhi deleted the referencemanycountbase branch June 28, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants