npm / @xyflow/react
@xyflow/react
What changed in @xyflow/react 11 to 13, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-23.
122 breaking80 new APIs and options9 performance26 behavior and defaults2 tooling38 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@xyflow/react 13123 changes
Breaking changes 78
Replaces NodeAddChange and EdgeAddChange.
Replaces NodeAddChange and EdgeAddChange as the generic add change type.
This helper is no longer exported; apply changes with the changeset's applyTo() method.
This helper is no longer exported; use the changeset’s applyTo() method instead.
The system color mode is now used by default; forceColorMode opts out.
React Flow 13 no longer supports the colorMode prop and detects the site's color mode automatically.
The colorMode prop is no longer supported; color mode is detected automatically, or can be forced with forceColorMode.
Replaces NodeDimensionChange; change types no longer use node and edge prefixes.
Replaces NodeDimensionChange as the generic change type for nodes and edges.
A changeset passed to onEdgesChange replaces the array of changes and provides methods to apply, filter, and retrieve changes.
Now defaults to true so overlapping edges can be reconnected by selecting them first.
Now defaults to true, elevating edges selected directly or through selection of connected nodes.
Now defaults to true, elevating edges when selected directly or when their connected nodes are selected.
The default padding is now 5%.
Numbers are now interpreted as pixel values instead of legacy units; use percentage values instead.
Unitless padding values are now interpreted as pixels.
Removed; use getNodeConnections({ nodeId, type, handleId }) instead.
Removed; use getNodeConnections({ nodeId, type, handleId }) from useReactFlow instead.
Use this useReactFlow method with nodeId, type, and handleId to retrieve NodeConnection objects.
The measured handle geometry type is now named HandleBounds.
The type was renamed to HandleBounds to avoid clashes with the Handle component.
The measured handle geometry type was renamed from Handle to avoid colliding with the Handle component.
New name for the Handle type, including types used for fromHandle or toHandle on ConnectionState.
The Handle type was renamed to HandleBounds to avoid a name clash with the Handle component.
Removed; use NodeConnection instead.
Clicks are suppressed only after a drag changed node positions; nodeDragThreshold and snapGrid control this.
A node click fires unless dragging moved the node or the pointer was released outside it; small pointer movements no longer suppress clicks.
Removed. Node clicks are suppressed only after a drag changes node positions; use nodeDragThreshold and snapGrid to control this.
Removed; if previously set, use its value for nodeDragThreshold instead.
The prop was removed; use nodeDragThreshold if you need to configure the drag threshold.
Use this in place of nodeClickDistance when a click-distance value was set; small pointer movements no longer prevent node clicks.
The to value is now in flow coordinates instead of screen coordinates.
The to value is now provided in flow coordinates rather than screen coordinates, on the FinalConnectionState passed as the last argument.
The to value on the FinalConnectionState argument is now in flow coordinates instead of screen coordinates.
Receives an EdgeChangeset class instead of the previous change value.
The handler now receives an EdgeChangeset instead of an array of changes; use its applyTo() method to apply changes.
The handler now receives an EdgeChangeset instead of an array of changes.
Receives a NodeChangeset class instead of the previous change value.
The handler now receives a NodeChangeset instead of an array of changes; use its applyTo() method to apply changes.
The handler now receives a NodeChangeset instead of an array of changes.
Replaced by paneDragThreshold.
Replaced by paneDragThreshold.
Replaced by paneDragThreshold, which controls when panning starts.
Replaces paneClickDistance and defaults to 1; panning or selecting starts only after pointer movement exceeds the threshold, otherwise the interaction counts as a click. Works with every mouse button.
Replaces paneClickDistance; the pane does not move until the pointer exceeds the threshold, while shorter movement fires onPaneClick.
Replaces paneClickDistance and delays panning until the pointer moves further than the configured pixel threshold.
Replaces NodePositionChange; change types no longer use node and edge prefixes.
Replaces NodePositionChange as the generic change type.
React 18 is now the minimum supported version.
Pane grab and grabbing cursors are set on a ::before overlay; custom cursor styles should target the pseudo-element.
Pane grab and grabbing cursors are applied to a ::before overlay rather than the pane itself; cursor customizations should target the pseudo-element.
The lib (react) entry was removed from the store.
React Flow 13 requires React 18 or higher.
Replaces NodeRemoveChange and EdgeRemoveChange.
Replaces NodeRemoveChange and EdgeRemoveChange as the generic remove change type.
Replaces NodeReplaceChange and EdgeReplaceChange as the generic replace change type.
Replaces NodeSelectionChange and EdgeSelectionChange.
Replaces NodeSelectionChange and EdgeSelectionChange as the generic selection change type.
The UMD build was removed.
React Flow 13 no longer ships a UMD build.
React Flow no longer ships a UMD build.
Store hooks no longer accept an equality function argument; use useShallow or useEqualSelector instead.
New selector for store hooks, which no longer accept an equality function as an argument.
The deprecated hook has been removed.
Removed; use useNodeConnections instead.
Use this hook to retrieve a list of NodeConnection objects in place of useHandleConnections.
Replaces useStoreApi and returns a ReactFlowStoreApi for accessing individual stores.
Replaces useStoreApi and provides access to individual React Flow stores through the returned API object.
Use useShallow instead of passing an equality function to the replacement store hooks.
Replaced by useNodesStore, useEdgesStore, useViewportStore, useOptionsStore, useConnectionStore, and useSelectionStore; the replacement hooks do not accept an equality function.
The hook is no longer available; use specialized store hooks instead.
The general store hook is no longer available; use specialized store hooks instead.
Renamed to useReactFlowStoreApi; the new hook provides access to the individual stores.
Renamed to useReactFlowStoreApi.
Styles shipped with React Flow are now wrapped in the xyflow CSS layer, affecting style precedence and layer ordering.
React Flow styles are now wrapped in the xyflow CSS layer, so layer ordering can determine how styles interact.
Projects using Zustand must update to Zustand 5.
Update to Zustand 5 before migrating if your project uses Zustand.
New APIs and options 32
Added to useReactFlow, useSvelteFlow, and useVueFlow to change a node's parent without calculating a new position.
New useReactFlow helper to update a node's parent while keeping its position on screen.
A new useReactFlow helper updates a node’s parent while keeping its position on screen.
Added as an opt-out from using system color mode by default.
Use this prop to force React Flow to use a specified color mode regardless of the site's color mode.
Forces React Flow to use a specified ColorMode regardless of the site’s detected color mode.
NodeChangeset and EdgeChangeset provide this utility method to get all changes of a specific type.
NodeChangeset and EdgeChangeset provide this utility method to get all changes for a specific node or edge.
Use this API in place of getHandleConnections; type is optional and id is now handleId. Added to useSvelteFlow.
Use this from useReactFlow instead of getHandleConnections; it returns a list of NodeConnection objects.
A changeset passed to onNodesChange replaces the array of changes and provides methods to apply, filter, and retrieve changes.
Replaces NodeReplaceChange and EdgeReplaceChange.
New specialized hook for accessing the connection store; it returns ConnectionStore.
Provides access to the connection store and returns ConnectionStore state.
Added a hook for subscribing to changes to a specific edge.
New specialized hook for accessing the edges store; it returns EdgesStore.
Provides access to the edges store and returns EdgesStore state.
Added the useEqualSelector hook.
Added a hook for subscribing to changes to a specific node.
Use this hook instead of useHandleConnections; it returns a list of NodeConnection objects.
New specialized hook for accessing the nodes store; it returns NodesStore.
Provides access to the nodes store and returns NodesStore state.
New specialized hook for accessing options; it returns ReactFlowState.
Provides access to the options store and returns ReactFlowState.
New specialized hook for accessing the selection store; it returns SelectionStore.
Provides access to the selection store and returns SelectionStore state.
Exported selector to use instead of passing an equality function to store hooks.
New specialized hook for accessing the viewport store; it returns ViewportStore.
Provides access to the viewport store and returns ViewportStore state.
Added a stylesheet that ships the xyflow default theme on top of base.css.
A style import is now available from this package path.
New separate CSS file providing the React Flow theme, available to import instead of the default styles.
Performance 2
The store is split into smaller stores, and components subscribed to a single node or edge only re-render when that element changes.
Consumers no longer re-render when only a node's position, selection, or measurements change.
Behavior and default changes 5
Exported styles now live in the @layer xyflow CSS layer.
In subflows, parent nodes may appear after their child nodes in the nodes array.
The connection APIs across frameworks now use NodeConnection.
Parent nodes no longer need to appear before child nodes in the nodes array.
For subflows, parent nodes can appear after their child nodes in the nodes array.
Fixes and other changes 6
EdgeToolbar uses the elevated zIndex so the toolbar stacks with its edge.
Moving a selected node with the arrow keys now announces its new position instead of its previous position.
Functions such as fitView and setCenter now resolve with false when user interaction or another viewport change interrupts the animation, instead of leaving promises pending.
The data type is narrowed by type when NodeProps receives a union of node types.
Animated viewport functions now resolve false if interrupted before reaching their target, instead of leaving promises unsettled.
Animated viewport functions resolve with false when interrupted instead of leaving their promises unsettled.
@xyflow/react 12115 changes
Breaking changes 32
Pane clicks no longer fire when a connection ends on the pane.
Using handleId without handleType now produces a type error.
Child nodes belonging to different parents are prevented from overlapping.
Custom implementations must handle the replace event; the reset event was removed.
Custom implementations must handle the replace event; the reset event was removed.
Replaces the react-flow__handle-connecting class for the connecting-from handle state.
Replaces the react-flow__handle-connecting class for the connecting-to handle state.
Edge updates no longer support object mutation; create and return a new edge when changing an attribute.
Renames the edge.updatable field to edge.reconnectable.
Renames edgesUpdatable to edgesReconnectable.
The deprecated function was removed.
The second argument now takes an options object containing nodeOrigin rather than nodeOrigin directly.
Removed; use getNodesBounds instead.
Removed; use getViewportForBounds instead.
Node updates no longer support object mutation; create and return a new node when changing an attribute.
Node height and width now specify fixed inline dimensions; measured dimensions are stored separately in node.measured.
Measured node dimensions are now stored in node.measured.width and node.measured.height rather than node.width and node.height.
Node width and height now specify fixed inline dimensions; measured dimensions are stored separately in node.measured.
Renames nodeInternals to nodeLookup for looking up nodes in the store.
The callback now fires for library-invoked viewport updates such as fitView or zoom-in.
Renames onEdgeUpdate to onReconnect; related edge reconnection callbacks, options, and fields are renamed to use reconnect terminology.
Renames onEdgeUpdateEnd to onReconnectEnd.
Renames onEdgeUpdateStart to onReconnectStart.
Renames the subflow node field parentNode to parentId.
Renames the custom node prop xPos to positionAbsoluteX.
Renames the custom node prop yPos to positionAbsoluteY.
Removed; use screenToFlowPosition instead.
Renames updateEdge to reconnectEdge for reconnecting edges.
Renames edgeUpdaterRadius to reconnectRadius.
The deprecated function was removed; reconnectEdge is the replacement.
Replaces the react-flow__handle-valid class for the valid handle state.
The package formerly named reactflow is now @xyflow/react, with named rather than default imports; style imports also use the new package path.
New APIs and options 28
Adds automatic panning when a user drags a selection close to the viewport edge.
Exports the NodeHandle type for use by developers.
screenToFlowPosition now accepts snapGrid in its options.
Adds a hook for applying middleware to node-change handling.
Adds zIndexMode to control how z-index is calculated for nodes and edges.
Adds the type property to EdgeProps, matching NodeProps behavior.
Adds the EdgeToolbar component for building toolbars associated with edges.
New prop controls the speed of auto panning.
New prop toggles built-in light, dark, or system color modes; dark mode adds a dark class to the wrapper.
New prop provides one validation function for all connections and is also called for programmatically added edges.
Node typing now supports defining a union of node types with distinct data structures, distinguished by node.type.
NodeProps now includes selectable, deletable, draggable, and parentId.
New handler lets applications prevent or manage deletions.
New combined handler for node and edge deletions.
New callback prop for controlled viewport changes.
Nodes now support an origin attribute.
New prop sets the maximum mousedown/up distance that will trigger a click.
New Background prop lets you style the background pattern with a class name.
Edges now support a selectable attribute.
Flows can be rendered on the server and hydrated on the client by defining node width, height, and handles.
New helper for updating edge data.
New useReactFlow function for updating nodes as part of managing data flow.
New useReactFlow function for updating node data as part of managing data flow.
New hook exposes the ongoing connection, including for styling handles or a custom connection line.
New hook for managing data flow between connected nodes.
New hook for managing data flow between nodes.
Controlled viewport support adds viewport and onViewportChange props, enabling use cases such as animating the viewport.
New component renders elements in the viewport without requiring a custom node.
Performance 7
MiniMap no longer re-renders on every store update, improving rendering performance.
Viewport pan and zoom transforms are applied imperatively so the component renders only once.
XYDrag instances are created only for draggable nodes, reducing unnecessary runtime work.
Optimizes zooming performance when panOnScroll mode is enabled.
Prevents unnecessary updates when selectNodesOnDrag is false.
Prevents unnecessary re-renders in FlowRenderer, improving rendering efficiency.
Improves the performance of adding nodes and edges.
Behavior and default changes 14
Development now logs when a user hides attribution.
Middle-mouse viewport panning can now start from a selection rectangle.
Control can activate pane panning during a primary-button drag.
Touch panning takes precedence over drag selection when selectionOnDrag is combined with mouse-button-specific panOnDrag settings.
useKeyPress now supports key combinations containing three or more keys.
Improves the return type so the data type can be narrowed by checking the node type.
Connections now receive the current pointer position.
The default paneClickDistance value is now 1.
Selections can now be started above a node.
Most styles now use CSS variables, which users can use to customize a flow.
The function now returns the deleted nodes and deleted edges.
The default nodeDragThreshold is now 1 instead of 0.
Library-created edges include sourceHandle only when it is set, rather than passing sourceHandle: null.
Library-created edges include targetHandle only when it is set, rather than passing targetHandle: null.
Tooling 2
Adds @types/react as an optional peer dependency to prevent pnpm strict-mode issues.
Adds @types/react-dom as an optional peer dependency to prevent pnpm strict-mode issues.
Fixes and other changes 32
The internal selection state is no longer mutated.
Respects nodeOrigin when passed a node object instead of { id }; getIntersectingNodes does too.
Clicking the pane cancels a pending click connection and calls onClickConnectEnd / onclickconnectend.
In EdgeProps, the type of pathOptions is inferred from the edge type instead of using any.
ResizeObservers are disconnected when a flow unmounts.
onResizeEnd now always fires after onResizeStart during resizing.
Fixes incorrect values during resize when shouldResize returns false.
Prevents the attribution warning when the pane is not rendered.
All properties in the provider store are reset when the flow unmounts.
MiniMap continues working after ReactFlow is remounted.
MiniMap no longer zooms out to include the origin when every node is hidden.
The Background pattern offset calculation is corrected.
extent: 'parent' now resolves immediately when the parent has width or initialWidth.
An error is now invoked when a handle cannot be found.
Internal setNodes now uses the correct nodeExtent.
The type now preserves its discriminated union, improving type-safe connection state handling.
Development warnings now use library-specific messages and correct documentation links.
Prevents node resizing beyond absolute extents.
Corrects the event type passed to onNodeDrag.
The type field may be omitted; omission is equivalent to type: "default".
Remounts no longer produce an empty store, improving ReactFlow state availability during remounts.
Viewport helper functions now receive options correctly when called through useReactFlow.
Visual node selection is cleared when no nodes remain selected in the flow.
Keeps isValidConnection up to date during an ongoing connection.
Handles an undefined node in the mini map.
Keeps onConnectEnd up to date during an ongoing connection.
Fixes programmatic selection issues by consolidating drag handler effects.
Ongoing connections now update when a user moves a node with the keyboard.
The selection box resets when a user selects a node.
onPaneClick events are no longer suppressed when selectionOnDrag=true.
NodeResizer props can change while a resize is in progress.
onMoveEnd is always called when onMoveStart was called.
@xyflow/react 1139 changes
Breaking changes 12
This prop was merged into defaultViewport.
Use defaultViewport in place of the merged defaultPosition and defaultZoom props to set the initial viewport.
This helper was removed; getBezierPath now returns the path and label position.
This helper was removed; use the path helper to obtain the edge label position.
Use this handler in place of onClickConnectStop.
This event handler was removed; use onClickConnectEnd instead.
Use this handler in place of onConnectStop.
This event handler was removed; use onConnectEnd instead.
React Flow 11 requires React 17 or greater.
The nocss entry point has been removed; adjust CSS entry points to load the styles directly.
The package react-flow-renderer was renamed to reactflow; the migration examples import ReactFlow from @xyflow/react.
Import this stylesheet for default styling; CSS is no longer injected, and React Flow will not work if styles are not loaded.
New APIs and options 20
Use ariaLabel options to control the default aria attributes for elements.
A Cross variant is available for the background pattern.
This component makes it easier to build custom edges.
Nodes and edges have a deletable option.
Disable keyboard accessibility controls with this prop.
This edge option renders an invisible edge to make edges easier to interact with.
Control the origin of a node, which is useful for layouting.
Add this class name to a custom node wrapper to disable panning over the node.
A new event handler for when the pointer enters the pane.
A new event handler for when the pointer leaves the pane.
A new event handler for pointer movement over the pane.
Edge pathOptions are available for smoothstep and default edges.
Background is available as a separately installable package.
Controls is available as a separately installable package.
Core is available as a separately installable package.
Minimap is available as a separately installable package.
Use this hook to handle selection changes within a component.
This hook returns true if all nodes are initialized and if there is more than one node.
Use this hook to handle viewport changes within a component.
Import this stylesheet when you want only basic styles.
Behavior and default changes 7
The cursor is grabbing while dragging a node or panning.
Routing for smoothstep and step edges is improved.
Edge updating behavior is improved.
The helper returns the path and label position, so callers can get both from one call.
Nodes and edges can be focused, selected, moved, and deleted using the keyboard.
The pane can be moved using the middle mouse button.
Panning over nodes is allowed when they are not draggable; add nopan to a custom node wrapper to disable this behavior.