marmelab / marmelab/react-admin
Redundant call to items in SelectArrayInput
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 26.9k
- Forks
- 5.5k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 19
Description
**Is your feature request related to a problem? Please describe.**
When I have basic usage of `SelectArrayInput` with `ReferenceArrayInput` and I know referenced data items will be always less than page size because they're static, I would like to avoid Get many call to selected items inside [`useReferenceArrayInputController`](https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts#L62) as it doesn't make sense to fetch the data again, I have all data I need and I (as a developer) assure that.
```tsx
```
my point is that there is no `filter` query parameter for these simple static (enum like) endpoints at our API.
**Describe the solution you'd like**
Allow manual suspend of request to getMany items in [`useReferenceArrayInputController`](https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/controller/input/useReferenceArrayInputController.ts#L68)
something like
```tsx
```
**Describe alternatives you've considered**
Don't have an idea how to solve this better 🤷♂️
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/ra-core/src/controller/input/useReferenceArrayInputController.ts at the linked request path, then trace how ReferenceArrayInput and SelectArrayInput use its data. Define the expected behavior for the proposed opt-out and check existing controller tests or usage patterns before changing the public API. Done means the option is documented and the redundant getMany request is skipped when it is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100