MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / getComponentKey

Function getComponentKey

code/redux/public/app.js:20501–20510  ·  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

20499 * @return {string}
20500 */
20501function getComponentKey(component, index) {
20502 // Do some typechecking here since we call this blindly. We want to ensure
20503 // that we don't block potential future ES APIs.
20504 if (typeof component === 'object' && component !== null && component.key != null) {
20505 // Explicit key
20506 return escape(component.key);
20507 }
20508 // Implicit key determined by the index in the set
20509 return index.toString(36);
20510}
20511
20512function forEachSingleChild(bookKeeping, child, name) {
20513 var func = bookKeeping.func,

Callers 1

traverseAllChildrenImplFunction · 0.70

Calls 1

escapeFunction · 0.70

Tested by

no test coverage detected