refactor(nodes): wrap with memo, update transform without creatin new array #282

This commit is contained in:
moklick
2020-06-05 12:55:11 +02:00
parent d5997ecbea
commit 6b8e7bfbc3
5 changed files with 22 additions and 28 deletions
+3 -3
View File
@@ -1,14 +1,14 @@
import React from 'react';
import React, { memo } from 'react';
import Handle from '../../components/Handle';
import { NodeProps, Position } from '../../types';
const OutputNode = ({ data, targetPosition = Position.Top }: NodeProps) => (
const OutputNode = memo(({ data, targetPosition = Position.Top }: NodeProps) => (
<>
<Handle type="target" position={targetPosition} />
{data.label}
</>
);
));
OutputNode.displayName = 'OutputNode';