mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-02 18:45:29 +08:00
### What problem does this PR solve? Feat: Use memo to wrap canvas nodes to improve fluency #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -14,7 +14,7 @@ import {
|
||||
SidebarHeader,
|
||||
SidebarMenu,
|
||||
} from '@/components/ui/sidebar';
|
||||
import { useMemo } from 'react';
|
||||
import { memo, useMemo } from 'react';
|
||||
import {
|
||||
AgentOperatorList,
|
||||
Operator,
|
||||
@ -77,7 +77,7 @@ function OperatorCollapsible({
|
||||
);
|
||||
}
|
||||
|
||||
export function AgentSidebar() {
|
||||
function InnerAgentSidebar() {
|
||||
const agentOperatorList = useMemo(() => {
|
||||
return componentMenuList.filter((x) =>
|
||||
AgentOperatorList.some((y) => y === x.name),
|
||||
@ -108,3 +108,5 @@ export function AgentSidebar() {
|
||||
</Sidebar>
|
||||
);
|
||||
}
|
||||
|
||||
export const AgentSidebar = memo(InnerAgentSidebar);
|
||||
|
||||
Reference in New Issue
Block a user