Closed herzog31 closed 4 years ago
@herzog31 Thanks for spotting this! Yes if the node is undefined, the call to unmount from react will throw an error. https://github.com/facebook/react/blob/master/packages/react-dom/src/__tests__/ReactMount-test.js#L30 But I would still check if there isn't some code that destroys the element somehow. The creation phase shouldn't leave the reference unassigned in the map. If you can reproduce it somehow to test it, I think that would be good.
Description
This PR fixes a potential exception with the
ReactDOM.unmountComponentAtNode
method call when the result of_rootShadows.get(this)
is undefined.I could consistently reproduce the issue in the context of the AEM editor, but couldn't find a minimal example to demonstrate the issue.
How Has This Been Tested?
Manual testing.
Types of changes
Checklist: