Unmount the react portal tree when unmounting the Portal component.
Unmount the react portal tree when unmounting the Portal component.

In addition to removing the portal element from the document we also need to unmount the React tree, otherwise these references are kept in memory.
jossmac/react-images