deep-jade
deep-jade2y ago

Making duplicate calls in the api

Using the github example (finefoods - mui), the application is making duplicate calls in the api Does anyone have a suggestion on how to solve this problem?
No description
7 Replies
Omer
Omer2y ago
Hey @pedrosilva8235 👋, Could it be related to react strict mode?
deep-jade
deep-jade2y ago
if it is about the "mutate" parameter, I tested with all the options, and the same problem occurs
Omer
Omer2y ago
Can you reproduce the same issue in our Ant design example? https://example.admin.refine.dev
Finefoods Ant Design Admin Panel - refine
Web site created using refine
deep-jade
deep-jade2y ago
I downloaded the updated code from github and ran it locally, for me it keeps duplicating requests
No description
deep-jade
deep-jade2y ago
One situation that I noticed was that running the compiled application, the problem does not occur
flat-fuchsia
flat-fuchsia2y ago
Hi @pedrosilva8235, This situation occurs because of Strict Mode https://reactjs.org/docs/strict-mode.html Strict Mode not running on production build. Because of that compiled application works as expected. If you remove StrictMode component in this file this situtation will not happen again. https://github.com/pankod/refine/blob/next/examples/fineFoods/admin/mui/src/index.tsx
adverse-sapphire
adverse-sapphire2y ago
Hey @pedrosilva8235 in addition to @alicanerdurmaz's explanation, you can use React Dev Tools extension on your browser to identify strict mode calls instead of disabling it. I think it's a good way to prevent bugs before happening 🚀