Skip to content

Commit

Permalink
Fix ref assignment in render (#2901)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment authored May 22, 2024
1 parent 1038d4b commit ba510a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderer/components/ReactFlowBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export const ReactFlowBox = memo(({ wrapperRef, nodeTypes, edgeTypes }: ReactFlo

const [nodes, setNodes, internalOnNodesChange] = useNodesState<NodeData>([]);
const [edges, setEdges, internalOnEdgesChange] = useEdgesState<EdgeData>([]);
setNodesRef.current = setNodes;
setEdgesRef.current = setEdges;
useEffect(() => {
setNodesRef.current = setNodes;
setEdgesRef.current = setEdges;
}, [setNodes, setEdges, setNodesRef, setEdgesRef]);

const altPressed = useKeyPress(['Alt', 'Option']);

Expand Down

0 comments on commit ba510a9

Please sign in to comment.