Fixed error when unmounting a React active view.