xyflow / xyflow

React Flow | Svelte Flow - Powerful open source libraries for building node-based UIs with React (https://reactflow.dev) or Svelte (https://svelteflow.dev). Ready out-of-the-box and infinitely customizable.
https://xyflow.com
MIT License
21.54k stars 1.43k forks source link

fix(react): handle setNodes batching in provider #4209

Closed moklick closed 3 weeks ago

moklick commented 3 weeks ago

This PR introduces a new Provider (BatchProvider) that handles the setNodes / updateNode / etc. batching. It's more or less the same code as it is now in the useReactFlow hook. The big difference is, that there is only one queue that is handles globally and not multiple ones for each useReactFlow hook. This prevents updates that overwrite each other.

closes #4207