Testing · Middle · Question 4 of 75
What does the warning “An update to Component inside a test was not wrapped in act(...)” usually mean?
- ✓Correct answer: State changed after the test stopped waiting - e.g. a request resolved after the last assertion
- 2React Testing Library is not installed
- 3The component uses class syntax
Explanation
RTL already wraps render and events in act. The fix is usually to wait for the final UI state with findBy/waitFor, not to add act manually.