How can I adding handles dynamically? #577
-
Hello, But before I call updateNodeInternals(['1']),
Or can I using this way to add a source type handle?
My use case is let end user to add/remove handle (for different meanings) on node. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You should basically never use The second way is also not okay, you cannot just add some arbitrary values for the handle, the values are calculated by the internal state management itself. Could you first describe what isn't working for you? Handles should automatically be detected, even without calling |
Beta Was this translation helpful? Give feedback.
You should basically never use
applyNodeChanges
to apply changes you create yourself.Changes are always emitted by the internal state management itself and all you need to do is either forward those to
applyNodeChanges
or let them be auto-applied (which is the default setting).The second way is also not okay, you cannot just add some arbitrary values for the handle, the values are calculated by the internal state management itself.
Could you first describe what isn't working for you? Handles should automatically be detected, even without calling
updateNodeInternals
(as they will try to add themselves to the correct handlebounds on mount of an handle if the handle doesn't exist yet).