浏览代码

memoize graph

AykutSarac 2 年之前
父节点
当前提交
c5521a4b27
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/components/Graph/index.tsx

+ 3 - 1
src/components/Graph/index.tsx

@@ -38,7 +38,7 @@ const StyledEditorWrapper = styled.div<{ isWidget: boolean }>`
   }
 `;
 
-export const Graph = ({
+const GraphComponent = ({
   isWidget,
   openModal,
   setSelectedNode,
@@ -130,3 +130,5 @@ export const Graph = ({
     </StyledEditorWrapper>
   );
 };
+
+export const Graph = React.memo(GraphComponent);