#Is there a recommended way to update values when handle inputs change?

1 messages · Page 1 of 1 (latest)

neon relic
#

If I have a node who's value is dependent on two nodes upstream of it, what's the best way to watch for changes and update the value? (basically how does the example on the homepage work https://reactflow.dev/)

Should I be keeping track of the targets via onConnect and useEffect on the nodes or is there some other way? a code example would be nice, but I couldn't find anything in the docs

tropic kestrel
neon relic
#

I see, thanks for the link

weary harness
#

we kind of cheat in this one, there's no actual "data flow" happening here (if you delete the edges it still works, for example)