ratty-blush
ratty-blush•2y 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
Omer•2y ago
Hey @pedrosilva8235 👋, Could it be related to react strict mode?
ratty-blush
ratty-blush•2y ago
if it is about the "mutate" parameter, I tested with all the options, and the same problem occurs
Omer
Omer•2y 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
ratty-blush
ratty-blush•2y ago
I downloaded the updated code from github and ran it locally, for me it keeps duplicating requests
No description
ratty-blush
ratty-blush•2y ago
One situation that I noticed was that running the compiled application, the problem does not occur
extended-salmon
extended-salmon•2y 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
exotic-emerald
exotic-emerald•2y 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 🚀