Skip to content
Discussion options

You must be logged in to vote

Hi Roman, I have just solve the issue.

I found that graph.getConnectedLinks(element) returns an empty array when using JointJS with React only in development mode (StrictMode enabled).

Root cause: I had two separate useEffect hooks—one for Paper initialization and another for rendering shapes—the cleanup function of the first effect calls graph.clear(), which empties the internal topologyIndex (new in v4.2.1). In StrictMode, React re-runs effects, but if the second effect's dependencies haven't changed, it won't re-execute, leaving the graph with an empty topologyIndex due to the first useEffect cleanup function that gets executed.

Thank you so much for your time!

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@kumilingus
Comment options

@marioml15
Comment options

Comment options

You must be logged in to vote
1 reply
@kumilingus
Comment options

Answer selected by marioml15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants