Skip to content

How can I adding handles dynamically? #577

Answered by bcakmakoglu
karenwanga asked this question in Q&A
Discussion options

You must be logged in to vote

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).

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bcakmakoglu
Comment options

@karenwanga
Comment options

@bcakmakoglu
Comment options

@karenwanga
Comment options

Answer selected by karenwanga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants