You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
The componentWillUnmount lifecycle method is not being called when a renderer is reused to render a component of a different type (which results in a new component instance being created and mounted).
constrenderer=reactTestRender.createRenderer(ComponentA)renderer.render()renderer._Component=ComponentBrenderer.render()// ComponentA#componentWillUnmount is not called.
This is why the component type cannot be swapped for a single renderer.
The raw ReactShallowRenderer from ReactTestUtils does not have this issue but it on the other hand does not call componentDidMount and componentDidUpdate. The correct tool for the tested situation has to be chosen for now.
The
componentWillUnmountlifecycle method is not being called when a renderer is reused to render a component of a different type (which results in a new component instance being created and mounted).Introduced by f3090d5
This is why the component type cannot be swapped for a single renderer.
The raw
ReactShallowRendererfromReactTestUtilsdoes not have this issue but it on the other hand does not callcomponentDidMountandcomponentDidUpdate. The correct tool for the tested situation has to be chosen for now.