We purge it [here](https://github.com/facebook/react/blob/b11540ccb2321aeb7259fcf0b3a38aeeea35231d/src/isomorphic/ReactDebugTool.js#L88-L89) but this code doesn’t run because of the [early exit](https://github.com/facebook/react/blob/b11540ccb2321aeb7259fcf0b3a38aeeea35231d/src/isomorphic/ReactDebugTool.js#L53-L57).

Need to fix this and add a test case to make sure we don’t regress on it.

if (!Array.isArray(pairs[0])) {
      pairs = [pairs];
    }
    var node = document.createElement('div');
    var currentElement;
    var rootInstance;
    class Wrapper extends React.Component {
      render() {
        rootInstance = ReactInstanceMap.get(this);
        return currentElement;
      }
    }
    function getActualTree() {
      return getTree(rootInstance._debugID, options).children[0];
    }
    
    
    pairs.forEach(([element, expectedTree]) => {
      currentElement = element;
      ReactDOM.render(<Wrapper />, node);
      expect(getActualTree()).toEqual(expectedTree);
      ReactComponentTreeDevtool.purgeUnmountedComponents();
      expect(getActualTree()).toEqual(expectedTree);
    });
    ReactDOM.unmountComponentAtNode(node);
    ReactComponentTreeDevtool.purgeUnmountedComponents();