### Website or app

https://github.com/eps1lon/react-devtools-repro-no-matching-node/

### Repro steps

1. `yarn start`
2. Open `App.js`
3. Uncomment the `useEffect` block
4. Click to inspect "Component" in DevTools
5. Error: "_Could not inspect element with id 5_"

Originally reported in https://github.com/facebook/react/issues/21436#issuecomment-835406075

---

https://user-images.githubusercontent.com/12292047/117544707-e6a6cd80-b022-11eb-9f8f-bb8cfd9f7743.mp4

### How often does this bug happen?

Every time

jest.spyOn(console, 'log').mockImplementation(() => {});
    jest.spyOn(console, 'warn').mockImplementation(() => {});
    const Target = React.memo(props => {
      targetRenderCount++;
      console.error('error');
      console.info('info');
      console.log('log');
      console.warn('warn');
      React.useState(0);
      return null;
    });
    const container = document.createElement('div');
    await utils.actAsync(() =>
      ReactDOM.render(<Target a={1} b="abc" />, container),
    );
    expect(targetRenderCount).toBe(1);
    expect(console.error).toHaveBeenCalledTimes(1);
    expect(console.error).toHaveBeenCalledWith('error');
    expect(console.info).toHaveBeenCalledTimes(1);
    expect(console.info).toHaveBeenCalledWith('info');
    expect(console.log).toHaveBeenCalledTimes(1);
    expect(console.log).toHaveBeenCalledWith('log');
    expect(console.warn).toHaveBeenCalledTimes(1);
    expect(console.warn).toHaveBeenCalledWith('warn');
    const inspectedElement = await inspectElementAtIndex(0);
    expect(inspectedElement).not.toBe(null);
    expect(targetRenderCount).toBe(2);
    expect(console.error).toHaveBeenCalledTimes(1);
    expect(console.info).toHaveBeenCalledTimes(1);
    expect(console.log).toHaveBeenCalledTimes(1);