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
Enzyme has shallow render API as not depending on DOM, which is based on shallow renderer.
Shallow renderer has some limitations, which means it doesn't support refs and componentDid〜 lifecycle methods.
(Enzyme supports componentDid〜 lifecycle methods with some hacks)
React provides react-test-renderer, which supports refs for composite components and all lifecycle methods.
(refs for DOM returns null)
I think it's a good option for testing components without DOM even though react-test-render may not work with old versions(< 0.14) of React.
Also react-test-renderer is based on FiberReconciler, which means the renderer might be able to support many features Fiber provides.
What do you think?
Thanks.
The text was updated successfully, but these errors were encountered:
Enzyme has
shallow
render API as not depending on DOM, which is based on shallow renderer.Shallow renderer has some limitations, which means it doesn't support refs and
componentDid〜
lifecycle methods.(Enzyme supports
componentDid〜
lifecycle methods with some hacks)React provides
react-test-renderer
, which supports refs for composite components and all lifecycle methods.(refs for DOM returns
null
)I think it's a good option for testing components without DOM even though
react-test-render
may not work with old versions(< 0.14
) of React.Also
react-test-renderer
is based on FiberReconciler, which means the renderer might be able to support many features Fiber provides.What do you think?
Thanks.
The text was updated successfully, but these errors were encountered: