TanStackT
TanStack4y ago
1 reply
sacred-rose

history.back() isn't working also the browser back and forward buttons are disabled

const location = new ReactLocation();
 <Router
            location={location}
            routes={[
              {
                path: '/',
                pendingElement: <SuspenseLoader />,
                element: async () => <Home />,
                onMatch: handleRouteMatch,
              },
              {
                path: 'login',
                pendingElement: <SuspenseLoader />,
                element: async () => <Login />,
                onMatch: handleRouteMatch,
              },
              {
                path: 'create',
                pendingElement: <SuspenseLoader />,
                element: async () => <CreateAvatar />,
                onMatch: handleRouteMatch,
              },
            ]}
          >

I want to let the user go back to the previous router using the history.back() method but it doesn't work also I noticed I can't do that through the browser navigation it looks like there is now history for this window any help is appreciated.
thanks in advance
Screenshot_2022-11-04_220151.png
Was this page helpful?