MCPcopy
hub / github.com/facebook/react / getID

Function getID

packages/react-devtools-shared/src/backend/legacy/renderer.js:192–202  ·  view source on GitHub ↗
(internalInstance: InternalInstance)

Source from the content-addressed store, hash-verified

190 }
191
192 function getID(internalInstance: InternalInstance): number {
193 if (typeof internalInstance !== 'object' || internalInstance === null) {
194 throw new Error('Invalid internal instance: ' + internalInstance);
195 }
196 if (!internalInstanceToIDMap.has(internalInstance)) {
197 const id = getUID();
198 internalInstanceToIDMap.set(internalInstance, id);
199 idToInternalInstanceMap.set(id, internalInstance);
200 }
201 return ((internalInstanceToIDMap.get(internalInstance): any): number);
202 }
203
204 function areEqualArrays(a: Array<any>, b: Array<any>) {
205 if (a.length !== b.length) {

Callers 8

mountComponentFunction · 0.85
performUpdateIfNecessaryFunction · 0.85
receiveComponentFunction · 0.85
unmountComponentFunction · 0.85
recordMountFunction · 0.85
flushInitialOperationsFunction · 0.85
inspectElementRawFunction · 0.85

Calls 4

getUIDFunction · 0.90
setMethod · 0.80
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected