Skip to content

Commit 3fda18b

Browse files
committed
Improve DataProviders documentation
1 parent 4413807 commit 3fda18b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/DataProviders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ queryClient.setMutationDefaults('banUser', {
10211021

10221022
## Handling Errors For Resumed Mutations
10231023

1024-
If you enabled offline support, users might trigger mutations while being actually offline. When they're back online, react-query will _resume_ those mutations and they might fail for other reasons (server side validation or errors). However, as users might have navigated away from the page that triggered the mutation, they won't see any notification.
1024+
If you enabled offline support, users might trigger mutations while being actually offline. When they're back online, TanStack Query will _resume_ those mutations and they might fail for other reasons (server side validation or errors). However, as users might have navigated away from the page that triggered the mutation, they won't see any notification.
10251025

10261026
To handle this scenario, you must register default `onError` side effects for all mutations (react-admin default ones or custom). If you want to leverage react-admin notifications, you can use a custom layout:
10271027

@@ -1033,7 +1033,7 @@ export const MyLayout = ({ children }: { children: React.ReactNode }) => {
10331033

10341034
React.useEffect(() => {
10351035
const mutationKeyFilter = []; // An empty array targets all mutations
1036-
queryClient.setMutationDefaults([], {
1036+
queryClient.setMutationDefaults(mutationKeyFilter, {
10371037
onSettled(data, error) {
10381038
if (error) {
10391039
notify(error.message, { type: 'error' });

0 commit comments

Comments
 (0)