Dealing with "act" warning on react testing - podcast episode cover

Dealing with "act" warning on react testing

Sep 03, 20216 minSeason 1Ep. 2
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

So I have a MainComponent, inside there are some “remote” components like OfficeSelect, that fetches data asynchronously on mount, using axios, everytime I test MainComponent I get the “act” warning on that OfficeSelect fetch, how do I deal with that?

Fix the “not wrapped in act(…)” warning

For the best experience, listen in Metacast app for iOS or Android