mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 23:26:38 +00:00
perf(RouteSchemaComponent): prevent unnecessary re-renders
This commit is contained in:
parent
15a68eef66
commit
c838ac70ad
@ -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 <RemoteSchemaComponent onlyRenderProperties uid={params.name} />;
|
||||
const currentPageUid = useCurrentPageUid();
|
||||
return <RemoteSchemaComponent onlyRenderProperties uid={currentPageUid} />;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user