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

[Doc] Fix useReference hook docs #8385

Merged
merged 3 commits into from
Nov 14, 2022
Merged

[Doc] Fix useReference hook docs #8385

merged 3 commits into from
Nov 14, 2022

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Nov 11, 2022

Fixes #8379

Comment on lines 93 to 95
## `useReference`

As `useGetManyAggregate` hook is often used to fetch references, react-admin exposes a `useReference` hook, which avoids doing the array conversion manually. It's an application hook rather than a data provider hook, so its syntax is a bit different. Prefer `useReference` to `useGetManyAggregate` when you use `useGetOne` to fetch a reference.
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it more confusing to split this into two sections, because both useGetManyAggregate and useReference aim at doing the same thing (only the cardinality differ), and both can fall under the category "Aggregating getOne Calls".
I found it clearer the way it was before.
@fzaninotto what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

agreed, I just modified it

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.

useReferenceFieldController Not found in code or documentation
3 participants