Duration
2 min
Access
Free
Transcript
Available

Any time your test interacts with a React component in a way that results in a state update, you need to make sure you wrap that interaction in an act function call, otherwise you'll get the "not wrapped in act(...)" warning.

In this lesson you'll learn how you can use act with @testing-library/react-hooks to avoid potential bugs in your custom React hooks.

This is based on my blog post: Fix the "not wrapped in act(...)" warning