Skip to content

Commit 75a332d

Browse files
committed
perf(platform): use React.memo render routes
1 parent f695966 commit 75a332d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/platform/src/app/Routes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface NonIndexRouteItem extends Omit<NonIndexRouteObject, 'children'>
5858
export type RouteItem = IndexRouteItem | NonIndexRouteItem;
5959

6060
// I have a great implementation of route caching, but considering the synchronization of data between pages (like modifying list or detail page data), I ended up not introducing route caching.
61-
export function AppRoutes() {
61+
export const AppRoutes = React.memo(() => {
6262
const ACLGuard = useACLGuard();
6363
const tokenGuard = useTokenGuard();
6464
const location = useLocation();
@@ -218,4 +218,4 @@ export function AppRoutes() {
218218
{element}
219219
</RouteStateContext.Provider>
220220
);
221-
}
221+
});

0 commit comments

Comments
 (0)