You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I check the selectedElement state on the React Dev Tools, I see that I actually store an reference to an Array:
I think the selectedElement is type of SingularElementArgument, so a single item collection.
I was wondering if it does make any sense to store the element reference as state:
Would a second selection of the same element give me the same object reference again?
Would it make more sense to store the element.id()?
Are there any drawbacks when storing the element ref as state?
The text was updated successfully, but these errors were encountered:
I'm listening to the
select
andunselect
events onnodes
andedges
and saving this asselectedElement
state:When I check the
selectedElement
state on the React Dev Tools, I see that I actually store an reference to an Array:I think the
selectedElement
is type ofSingularElementArgument
, so a single item collection.I was wondering if it does make any sense to store the element reference as state:
Would a second selection of the same element give me the same object reference again?
Would it make more sense to store the
element.id()
?Are there any drawbacks when storing the element ref as state?
The text was updated successfully, but these errors were encountered: