From c838ac70adc2edee5eb4b4e74f678b6f87e10040 Mon Sep 17 00:00:00 2001
From: Zeke Zhang <958414905@qq.com>
Date: Sun, 3 Nov 2024 19:37:52 +0800
Subject: [PATCH] perf(RouteSchemaComponent): prevent unnecessary re-renders
---
.../src/route-switch/antd/route-schema-component/index.tsx | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/packages/core/client/src/route-switch/antd/route-schema-component/index.tsx b/packages/core/client/src/route-switch/antd/route-schema-component/index.tsx
index 00bbc31ff7..9881eb4d5c 100644
--- a/packages/core/client/src/route-switch/antd/route-schema-component/index.tsx
+++ b/packages/core/client/src/route-switch/antd/route-schema-component/index.tsx
@@ -8,10 +8,9 @@
*/
import React from 'react';
-import { useParams } from 'react-router-dom';
-import { RemoteSchemaComponent } from '../../../';
+import { RemoteSchemaComponent, useCurrentPageUid } from '../../../';
export function RouteSchemaComponent() {
- const params = useParams();
- return ;
+ const currentPageUid = useCurrentPageUid();
+ return ;
}