* Finds the node with the supplied public React instance. * * @param {*} instance A public React instance. * @return {?DOMElement} DOM node with the suppled `id`. * @internal
(instance)
| 10764 | * @internal |
| 10765 | */ |
| 10766 | function getNodeFromInstance(instance) { |
| 10767 | var id = ReactInstanceMap.get(instance)._rootNodeID; |
| 10768 | if (ReactEmptyComponentRegistry.isNullComponentID(id)) { |
| 10769 | return null; |
| 10770 | } |
| 10771 | if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { |
| 10772 | nodeCache[id] = ReactMount.findReactNodeByID(id); |
| 10773 | } |
| 10774 | return nodeCache[id]; |
| 10775 | } |
| 10776 | |
| 10777 | /** |
| 10778 | * A node is "valid" if it is contained by a currently mounted container. |