Replies: 2 comments 1 reply
-
Ah, sorry just found this link: https://reactflow.dev/docs/guides/state-management/ I'll use that. Either way, should I avoid using |
Beta Was this translation helpful? Give feedback.
1 reply
-
You need return the array from https://reactflow.dev/examples/nodes/update-node setNodes((nds) =>
nds.map((node) => { But in your code the function is enclosed without return the value: reactFlowInstance.setNodes((nodes) => {
nodes.map((node) => { Add a reactFlowInstance.setNodes((nodes) => {
return nodes.map((node) => { reactFlowInstance.setNodes((nodes) =>
nodes.map((node) => { |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, probably a simple question, but can't find the answer anywhere.
How do I pass in
setNodes
into thedata
field for custom edges/nodes?In other words, I have a custom edge with a button that hides a target node. How can I call
setNodes
in this custom node to do so? I tried the followingDoing the above runs into an error saying that
nextNodes
is null.I also tried using
useStoreApi
but couldn't get that to work.Is there another way I'm missing?
Beta Was this translation helpful? Give feedback.
All reactions