MCPcopy Index your code
hub / github.com/plotly/dash / getElementKey

Function getElementKey

dash/deps/react@18.2.0.js:992–1006  ·  view source on GitHub ↗

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

(element, index)

Source from the content-addressed store, hash-verified

990
991
992 function getElementKey(element, index) {
993 // Do some typechecking here since we call this blindly. We want to ensure
994 // that we don't block potential future ES APIs.
995 if (typeof element === 'object' && element !== null && element.key != null) {
996 // Explicit key
997 {
998 checkKeyStringCoercion(element.key);
999 }
1000
1001 return escape('' + element.key);
1002 } // Implicit key determined by the index in the set
1003
1004
1005 return index.toString(36);
1006 }
1007
1008 function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1009 var type = typeof children;

Callers 1

mapIntoArrayFunction · 0.70

Calls 3

checkKeyStringCoercionFunction · 0.70
escapeFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…