How to simulate component unmount and test useEffect cleanup function with React Testing Library
I want to test a cleanup function in the return of useEffect but I’m unable to simulate unmounting a component.
I want to test a cleanup function in the return of useEffect but I’m unable to simulate unmounting a component.