|
@@ -2,7 +2,7 @@ import React from "react";
|
|
import { CustomNodeProps } from "src/components/CustomNode";
|
|
import { CustomNodeProps } from "src/components/CustomNode";
|
|
import * as Styled from "./styles";
|
|
import * as Styled from "./styles";
|
|
|
|
|
|
-const ObjectNode: React.FC<CustomNodeProps> = ({ node, x, y }) => {
|
|
|
|
|
|
+export const ObjectNode: React.FC<CustomNodeProps> = ({ node, x, y }) => {
|
|
const { text, width, height, data } = node;
|
|
const { text, width, height, data } = node;
|
|
const ref = React.useRef(null);
|
|
const ref = React.useRef(null);
|
|
|
|
|
|
@@ -28,10 +28,4 @@ const ObjectNode: React.FC<CustomNodeProps> = ({ node, x, y }) => {
|
|
})}
|
|
})}
|
|
</Styled.StyledForeignObject>
|
|
</Styled.StyledForeignObject>
|
|
);
|
|
);
|
|
-};
|
|
|
|
-
|
|
|
|
-function propsAreEqual(prev: CustomNodeProps, next: CustomNodeProps) {
|
|
|
|
- return String(prev.node.text) === String(next.node.text) && prev.node.width === next.node.width;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-export default React.memo(ObjectNode, propsAreEqual);
|
|
|
|
|
|
+};
|