Library breaks when trying to create an Edge from a Handle that is generated programmatically
See original GitHub issueHi guys! First of all, thanks for the amazing library that React Flow is.
I’ve a Custom Node where I need to programmatically generate the Source Handles based on a list stored in data; the list is named groups and contains strings like ‘1’, ‘2’, …
id is the Node Id.
const outputHandles = groups.map((group: string, outputIdx: number) => {
const handleId = `${id}|${outputIdx}`;
const leftPos = `${((100 / (groups.length + 1)) * (outputIdx + 1))}%`;
return <Handle
type="source"
position={Position.Bottom}
id={handleId}
key={handleId}
style={{ left: leftPos, background: getGroupColor(group) }}
/>;
});
The Node is generated correctly showing an handle for each group, but when I try to drag a Edge out of the Handle I get this error:
scheduler.development.js:178 Uncaught TypeError: Cannot read property 'find' of null
at ConnectionLine (cjs.js:12)
at renderWithHooks (react-dom.development.js:14803)
at updateFunctionComponent (react-dom.development.js:17034)
at beginWork (react-dom.development.js:18610)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at beginWork$1 (react-dom.development.js:23203)
at performUnitOfWork (react-dom.development.js:22154)
at workLoopSync (react-dom.development.js:22130)
at performSyncWorkOnRoot (react-dom.development.js:21756)
at react-dom.development.js:11089
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at flushSyncCallbackQueueImpl (react-dom.development.js:11084)
at flushSyncCallbackQueue (react-dom.development.js:11072)
at flushPassiveEffectsImpl (react-dom.development.js:22883)
at unstable_runWithPriority (scheduler.development.js:653)
at runWithPriority$1 (react-dom.development.js:11039)
at flushPassiveEffects (react-dom.development.js:22820)
at react-dom.development.js:22699
at workLoop (scheduler.development.js:597)
at flushWork (scheduler.development.js:552)
at MessagePort.performWorkUntilDeadline (scheduler.development.js:164)
Issue Analytics
- State:
- Created 3 years ago
- Comments:24 (11 by maintainers)
Top Results From Across the Web
Attach event to dynamic elements in javascript - Stack Overflow
myClass` will trigger the callback, // even elements created dynamically after the event listener was created. addDynamicEventListener(document.body ...
Read more >Dynamic link library (DLL) - Windows Client | Microsoft Learn
This article describes what a dynamic link library (DLL) is and the various issues ... When a program uses a DLL, a dependency...
Read more >Auto Layout Guide: Anatomy of a Constraint - Apple Developer
Describes the constraint-based system for laying out user interface elements.
Read more >Common Flutter errors
To fix this error, specify how tall the ListView should be. To make it as tall as the remaining space in the Column...
Read more >API - esbuild
There are two main API calls in esbuild's API: transform and build. ... in all cases (and doesn't try to be), it strives...
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

Hi Jaspooky, I missed that provider part in doc, it is working now when implemented in children of provider.
updateNodeInternals takes the ID of the node, you are passing the ID of the handle,