Comments (3)
a minor nitpicking about: https://reactflow.dev/api-reference/utils/apply-node-changes
const [nodes, setNodes] = useState([]);
const [edges, setEdges] = useState([]);
const onNodesChange = useCallback(
(changes) => {
setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));
},
[setNodes],
);
it is not necessary to add setNodes
to the dependencies.
see: https://react.dev/reference/react/useCallback#updating-state-from-a-memoized-callback
from xyflow.
seems to be related to #3946
from xyflow.
You can use getNodes
from useReactFlow
inside your layout function to get the current nodes without passing nodes
as a dependency. Does that help?
from xyflow.
Related Issues (20)
- updateNodeData does not run consistently in 12.0.0-next.12, next.13, next.14 HOT 5
- 90% GPU utilization for animated edges HOT 2
- Edges not rendering with production build. HOT 5
- Get relative node position on Edge Drop for new node with parentNode HOT 1
- Select text inside node: chrome bug for transformed elements HOT 3
- [React flow] Flickering / z-fighting / re-rendering between canvas & nodes on click/drag, introduced in 11.10.4 HOT 1
- [SvelteFlow] Nodes with unchanged IDs becoming invisible in SvelteFlow 0.0.40 HOT 2
- Setting connectionMode to loose prevents self-connections from handles rendered in the same CustomNode
- Firefox: The selection is reset to none. HOT 2
- Cannot pass component as a label. HOT 6
- [V12.next12] updateNodeData / updateNode will reset node width / height if not provided in the update HOT 4
- Can't use onDoubleClick on ReactFlow component
- Zoom: CTRL + SCROLL with pan activated only works if clicked on pane before HOT 1
- `isValidConnection` prop on `SvelteFlow` doesn't trigger for attempted target to target or source to source handle connections HOT 2
- Internal nodes: calculate render position
- Misalignment of Edges in ReactFlow Component when Zoom Ratio Changes using scale transfrom css HOT 4
- [v12]: `pathOptions` not recognized anymore
- `MiniMap`'s mask doesn't cover the entire area HOT 1
- Having multiple edges pointing to one single handle, makes it hard for the user to update an edge from a handle to another
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xyflow.