We used to work with reactDom.render for our testing. We started having problems when trying to test function component. In these case, the tests continued before all hooks were processed. I started looking for a solution, and I found out that react-testing-library implements render function as well. It seems to solve the problem. + using act() in some cases.
The returned value from react-testing-library render() is a special object with the html container and not a React component. In that case we cannot use reactDom test utils anymore, since they expect components.
I'm a bit confused with all these libraries, and not sure what is the right approach to test our application. Can anyone elaborate the differences between the two libraries? When to use act? (I found this post suggested not to use act in render: react-test-renderer's create() vs. @testing-library/react's render())
Thanks!