MCPcopy Index your code
hub / github.com/microsoft/SandDance / getComponentKey

Function getComponentKey

docs/external/js/react.development.js:1189–1199  ·  view source on GitHub ↗

* Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string}

(component, index)

Source from the content-addressed store, hash-verified

1187
1188
1189 function getComponentKey(component, index) {
1190 // Do some typechecking here since we call this blindly. We want to ensure
1191 // that we don't block potential future ES APIs.
1192 if (typeof component === 'object' && component !== null && component.key != null) {
1193 // Explicit key
1194 return escape(component.key);
1195 } // Implicit key determined by the index in the set
1196
1197
1198 return index.toString(36);
1199 }
1200
1201 function forEachSingleChild(bookKeeping, child, name) {
1202 var func = bookKeeping.func,

Callers 1

traverseAllChildrenImplFunction · 0.85

Calls 2

escapeFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected