DEV Community

Discussion on: Writing unit tests with React, Typescript, and react-testing-library

jacobmgevans profile image
Jacob Evans • Edited on

Could you use act() on the behavior that is expected to cause a rerender rather than directly changes props?

wojciechmatuszewski profile image
Wojciech Matuszewski Author • Edited on

In theory - yes, but react-testing-library is already doing that for you (plus some other stuff)

(act is used within render and render is used within rerender)