Explain it in 60 seconds
Understanding act() warnings in React tests
Frontend Engineering · Testing and Tooling · Intermediate
What does React's "not wrapped in act(...)" warning mean, and how do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- State update happened outside test's awareness.
- Usually async update after test finished.
- Use findBy/waitFor to await UI.
- Testing Library wraps events in act.
- Clean up timers/subscriptions.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.