* 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)
| 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, |
no test coverage detected