TanStackT
TanStack3y ago
4 replies
brilliant-lime

Handling Component Display Scenarios in a Dynamic Data Loading Environment

In a given scenario, a loader attempts to retrieve data, but encounters an outage in the service. This results in the display of an error component. Subsequently, even after the service is restored, the error component persists instead of the intended component.

export const postsRoute = new Route({
  getParentRoute: () => rootRoute,
  path: "posts",
  loader: async ({
    context: { queryClient },
    routeContext: { postsOptions },
  }) => {
    queryClient.ensureQueryData(postsOptions);
  },
  component: Posts,
  errorComponent: ErrorPost
});


I have also tried using the update but results remains the same.
Was this page helpful?