* A node is "valid" if it is contained by a currently mounted container. * * This means that the node does not have to be contained by a document in * order to be considered valid. * * @param {?DOMElement} node The candidate DOM node. * @param {string} id The expected ID of the node. * @retur
(node, id)
| 10785 | * @return {boolean} Whether the node is contained by a mounted container. |
| 10786 | */ |
| 10787 | function isValid(node, id) { |
| 10788 | if (node) { |
| 10789 | !(internalGetID(node) === id) ? "development" !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined; |
| 10790 | |
| 10791 | var container = ReactMount.findReactContainerForID(id); |
| 10792 | if (container && containsNode(container, node)) { |
| 10793 | return true; |
| 10794 | } |
| 10795 | } |
| 10796 | |
| 10797 | return false; |
| 10798 | } |
| 10799 | |
| 10800 | /** |
| 10801 | * Causes the cache to forget about one React-specific ID. |
no test coverage detected