(internalInstance: InternalInstance)
| 60 | type LegacyRenderer = Object; |
| 61 | |
| 62 | function getData(internalInstance: InternalInstance) { |
| 63 | let displayName = null; |
| 64 | let key = null; |
| 65 | |
| 66 | // != used deliberately here to catch undefined and null |
| 67 | if (internalInstance._currentElement != null) { |
| 68 | if (internalInstance._currentElement.key) { |
| 69 | key = String(internalInstance._currentElement.key); |
| 70 | } |
| 71 | |
| 72 | const elementType = internalInstance._currentElement.type; |
| 73 | if (typeof elementType === 'string') { |
| 74 | displayName = elementType; |
| 75 | } else if (typeof elementType === 'function') { |
| 76 | displayName = getDisplayName(elementType); |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | return { |
| 81 | displayName, |
| 82 | key, |
| 83 | }; |
| 84 | } |
| 85 | |
| 86 | function getElementType(internalInstance: InternalInstance): ElementType { |
| 87 | // != used deliberately here to catch undefined and null |
no test coverage detected