-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeEditor ignores changes to nodes
parameter after initial render
#119
Comments
I just realized this was closed, but might actually be my problem. Did you ever find a work-around for this? |
I found a work around here. You can assign the key prop of the for eg: if
and render like
|
@idling-mind That was helpful in keeping the nodes, but the connections don't seem to re-render for some reason. As you can see, it seems from the console.logged node that the connection is still there, but they're just not rendering after goes away, or is replaced (say I switch to one of the tabs on the top or switch out one key'd node editor for another by selecting it on the right. (Initial State - the connections are drawn) (Final State - I swapped views and came back, the nodes are there, the connection data is in tact from above, but the connections are now missing and no longer work). Not sure where they're going, and I'm still a bit of a react noob, so maybe I'm overlooking some newbie mistake with react or redux, but of course, if the connection system breaks then I didn't do a good job of saving the state and the app is broken from then on. I would try digging into the source, but I'm not sure how to do that with an NPM JS project verses a traditional JS script. |
I'm also not sure why the connection should disappear. May be try different versions of the libraries? |
I'm running into this problem in |
This is a consistent pain point from an original design decision that makes updating the nodes dynamically difficult for performance. I'm going to get this fixed so it wi work like you'd expect a controlled react component to work. I'm in the process of converting the whole library to typescript and then this feature is up next. |
Is there any update on this? I'm building a web app that uses this, and unfortunately I'm a react noob |
Maybe creating a new imperative method to load the new nodes should work? If we can't update the state directly for performance reasons, having a chance to update via a method can be good enough for most of the cases. i`ve made a PR to propose a solution, hope you like it. (link) |
Any way to break into it would be awesome. |
Unfortunately this seems to be by design, but it complicates what should be the basic function of loading in a graph.
NodeEditor provides a way to retrieve the nodes and I am saving them out to localStorage, but I'm unable to actually populate the graph with any nodes by manually changing the nodes object after the editor has been rendered.
The text was updated successfully, but these errors were encountered: