fix(web): preserve route state and cancel stale reads
This commit is contained in:
@@ -65,7 +65,7 @@ class RecoverableRouteBoundary extends Component<{ children: ReactNode; routeKey
|
||||
export function RoutePage({ page: Page, label }: { page: ElementType; label: string }) {
|
||||
const location = useLocation();
|
||||
const routeKey = `${location.pathname}${location.search}`;
|
||||
return <RecoverableRouteBoundary key={routeKey} routeKey={routeKey}>
|
||||
return <RecoverableRouteBoundary key={location.pathname} routeKey={routeKey}>
|
||||
<Suspense fallback={<PageLoading label={`正在加载${label}`} />}><Page /></Suspense>
|
||||
</RecoverableRouteBoundary>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user