perf(RouteSchemaComponent): prevent unnecessary re-renders

This commit is contained in:
Zeke Zhang 2024-11-03 19:37:52 +08:00
parent 15a68eef66
commit c838ac70ad

View File

@ -8,10 +8,9 @@
*/ */
import React from 'react'; import React from 'react';
import { useParams } from 'react-router-dom'; import { RemoteSchemaComponent, useCurrentPageUid } from '../../../';
import { RemoteSchemaComponent } from '../../../';
export function RouteSchemaComponent() { export function RouteSchemaComponent() {
const params = useParams(); const currentPageUid = useCurrentPageUid();
return <RemoteSchemaComponent onlyRenderProperties uid={params.name} />; return <RemoteSchemaComponent onlyRenderProperties uid={currentPageUid} />;
} }