-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Performance]Too many request to API endpoint when using ReferenceInput and ReferenceArrayInput #3108
Comments
Hi, and thanks for your question. As explained in the react-admin contributing guide, the right place to ask a "How To" question, get usage advice, or troubleshoot your own code, is StackOverFlow. This makes your question easy to find by the core team, and the developer community. Unlike Github, StackOverFlow has great SEO, gamification, voting, and reputation. That's why we chose it, and decided to keep GitHub issues only for bugs and feature requests. So I'm closing this issue, and inviting you to ask your question at: http://stackoverflow.com/questions/tagged/react-admin And once you get a response, please continue to hang out on the react-admin channel in StackOverflow. That way, you can help newcomers and share your expertise! |
Hi @djhi , it's my mistake of using "word". I've update this post |
Thanks for reporting this. If you are able to illustrate the bug or feature request with an example, please provide a sample application via one of the following means:
|
I can confirm the problem on the simple example:
Each click on a checkbox calls the dataProvider, as seen on this screenshot: |
The problem comes from ReferenceArrayInputController, who fetches references each time the value changes: react-admin/packages/ra-core/src/controller/input/ReferenceArrayInputController.tsx Lines 170 to 203 in 5ec9cd6
I'm not sure we can change that, as it's necessary to force fetching of actual values when the parent updates... |
The best we could do is first check if the values aren't in the options, and only then trigger a fetchReferences. |
Hello ! Thanks for the project :) |
Same behavior with the 2.9.3 version. I have the same problem on my side with text inputs. |
me too |
@fzaninotto actually this componentWillReceiveProps is deprecated better move to componentDidUpdate for a side effect. |
Hi, first words, thanks for your awesome project.
I have use ReferenceInput and ReferenceArrayInput in my form like this:
But when i check the checkbox, this component send too much request to server. I think it's not necessary.
After the input mounted and load reference data. It's should be not need load reference data again when changing the value of input
The text was updated successfully, but these errors were encountered: