a utility to unmount enzyme renders
npm install enzyme-cleanupSee this issue for more information.
``bash`
npm i -D eynzme-cleanup or yarn add -D eynzme-cleanup
Then, add this to your jest setup script.
`js
import { configure } from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import { cleanup, makeAdapter } from 'enzyme-cleanup'
// afterEach is a global jest method
afterEach(cleanup)
configure({ adapter: makeAdapter(Adapter) })
`
If you are not using jest, you can call enzymeCleanup()` however you see fit.
Can be used with any enzyme adapter.