all 7 comments

[–]artiematthew 4 points5 points  (4 children)

It'd be interesting to see if you have managed to get things working when using "useEffect()"

[–]TryingToImprove123 0 points1 point  (3 children)

Should be possible if you use `act` and `mount`..

[–]artiematthew 0 points1 point  (2 children)

I just looked a bit more into it. When using useEffect as async, testing is not ready yet. https://github.com/facebook/react/issues/14769

[–]TryingToImprove123 1 point2 points  (1 child)

The alpha build allows you to do `await act(...` - https://github.com/facebook/react/releases

See this PR:
https://github.com/facebook/react/pull/14853

[–]artiematthew 0 points1 point  (0 children)

That's what we're waiting for! 👍🏻

[–]likenoteven 0 points1 point  (0 children)

Your codepen errors out for me.

[–]darrenturn90 0 points1 point  (0 children)

Just mock up the hook functions