fix(useReactFlow): prevent unnecessary re-renderings

This commit is contained in:
moklick
2022-08-16 12:44:47 +02:00
parent 196f225aac
commit bb00e871c0
6 changed files with 22 additions and 21 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ const CustomNodeFlow = () => {
connectionLineStyle={connectionLineStyle}
snapToGrid={true}
snapGrid={snapGrid}
defaultZoom={0.3}
fitView
minZoom={0.3}
maxZoom={2}
>
+1 -1
View File
@@ -86,7 +86,7 @@ const UseZoomPanHelperFlow = () => {
const logNodes = useCallback(() => {
console.log('nodes', getNodes());
console.log('edges', getEdges());
}, [getNodes]);
}, [getNodes, getEdges]);
useEffect(() => {
addEdges({ id: 'e3-4', source: '3', target: '4' });