-
Notifications
You must be signed in to change notification settings - Fork 412
Description
I have seen issues with some of my functional components processed/created by Reagent when using the React strict mode. However, it doesn't seem possible to define tests in Reagent that reproduce the issue because, as far as I can tell, the top-level component in tests is always reagent$dom$client$reagent_root
. When I define a custom component and run reagenttest.utils/with-render
in my test, following the example of existing tests, adding [:> react/StrictMode #js {} ...]
there doesn't have the desired effect because it's not at the top level and so React does not run the extra cycle of React effect hooks (see the note at the end of this chapter of React docs).
As of this writing, I have been able to reproduce my issue only by replacing the .render
call in the reagent.dom.client/render
function with:
(.render root
(react/createElement
react/StrictMode
#js {}
(react/createElement reagent-root js-props)))
I think this should be exposed to tests as a regular option of the testing functions (with-render
in particular).