Use global id for debugcomponent id

Summary: Global Id is stable as the component is rerendered. It is not stable if the whole component tree updates so we might want to deal with this in the future

Reviewed By: lblasa

Differential Revision: D41581346

fbshipit-source-id: 0c2834ba452ddcfc3e0a7392672825fc040901d9
This commit is contained in:
Luke De Feo
2022-11-29 08:54:58 -08:00
committed by Facebook GitHub Bot
parent cffe42a93a
commit d0a05ad1a9

View File

@@ -26,7 +26,7 @@ class DebugComponentDescriptor(val register: DescriptorRegister) : NodeDescripto
* Debug component is generated on the fly so use the underlying component instance which is * Debug component is generated on the fly so use the underlying component instance which is
* immutable * immutable
*/ */
override fun getId(node: DebugComponent): Id = System.identityHashCode(node.component) override fun getId(node: DebugComponent): Id = node.globalKey.hashCode()
override fun getName(node: DebugComponent): String = node.component.simpleName override fun getName(node: DebugComponent): String = node.component.simpleName