Dynamically changed Handles cause a break
See original GitHub issueHey! First off let me say thanks for creating this awesome package!
I have different NodeTypes that have different amount of <Handles/> on them. There is one component in particular that you make some selections, and based off the selections you make, it changes the elements type. The re-rendering happens and everything looks as it should, but when you select a Handle, it errors out.
I’ve been able to trace it to:
- The Node originally renders with
0Handles. - Make sidebar selections.
- Node changes type to where it now has
2Handles. - Those handles can no longer be connected and error out.
The error I receive is:
ReactFlow.esm.js:7195 Uncaught TypeError: Cannot read property '0' of null
at ConnectionLine (ReactFlow.esm.js:7195)
at renderWithHooks (react-dom.development.js:14826)
at updateFunctionComponent (react-dom.development.js:17059)
at beginWork (react-dom.development.js:18644)
at HTMLUnknownElement.callCallback (react-dom.development.js:189)
at Object.invokeGuardedCallbackDev (react-dom.development.js:238)
at invokeGuardedCallback (react-dom.development.js:293)
at beginWork$1 (react-dom.development.js:23235)
at performUnitOfWork (react-dom.development.js:22186)
at workLoopSync (react-dom.development.js:22162)
at performSyncWorkOnRoot (react-dom.development.js:21788)
at react-dom.development.js:11112
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11062)
at flushSyncCallbackQueueImpl (react-dom.development.js:11107)
at flushSyncCallbackQueue (react-dom.development.js:11095)
at flushPendingDiscreteUpdates (react-dom.development.js:21879)
at flushDiscreteUpdates (react-dom.development.js:21859)
at flushDiscreteUpdatesIfNeeded (react-dom.development.js:1095)
at dispatchDiscreteEvent (react-dom.development.js:4168)```
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Dynamic array formulas and spilled array behavior
Excel formulas that return a set of values, also known as an array, return these values to neighboring cells. This behavior is called...
Read more >Dynamic Web Elements in Web Automation | by Adil Qayyum
If you are automating a dynamic website, the scripts will break as soon as the content changes which will cause your test to...
Read more >How to dynamically handle changes in a JSON object name ...
The code shows a messagebox, if they have changed to an unknown name. Then find the new name add it to the list...
Read more >Is it possible to render components "dynamically" using Blazor?
It's all very nice and predictable when you can look at the code and see exactly which components are being rendered on any...
Read more >Finding and fixing the cause of your dynamic link errors
Dynamic Link changed a lot of workflows for a lot of users, and was one of the ... and you will also have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @moklick! Looks like that fixed my issue. Appreciate you getting to it so fast!
Thanks so much!
Yea I started to trace it down and it looks like, we
querySelectorAllfor the Handles only once. If it happened whenever thetypechanged then it would probably fix it.