You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you were expecting: useGetOne and useGetList only trigger one call to the API.
What happened instead:
They call the API twice
Steps to reproduce:
Launch the simple example
Go to a comment edit page
The getOne and getList calls are doubled.
Note that the duplication disappears when I remove StrictMode. However, the example is using React 18, so this isn't caused by changes in strict mode in React 19. When using react-admin v4 with React 18, the bug doesn't appear, so this a regression introduced by v5.
I can confirm that by removing the signal in useGetOne, the getOne request is no longer duplicated. But this is very surprising: the demo uses ra-data-fakerest, which doesn't implement the abortSignal.
All in all, it means that all apps, whatever their data provider, will see duplicated queries in strict mode by default. The developer experience is worse in general, for an end user benefit that only occurs in a minority of cases.
We need to disable the abortsignal by default, and find a way to make it an opt-in feature.
What you were expecting:
useGetOne
anduseGetList
only trigger one call to the API.What happened instead:
They call the API twice
Steps to reproduce:
getOne
andgetList
calls are doubled.Note that the duplication disappears when I remove StrictMode. However, the example is using React 18, so this isn't caused by changes in strict mode in React 19. When using react-admin v4 with React 18, the bug doesn't appear, so this a regression introduced by v5.
Related code:
https://stackblitz.com/github/marmelab/react-admin/tree/next/examples/simple
Environment
The text was updated successfully, but these errors were encountered: