PLAY PODCASTS
Dealing with "act" warning on react testing
Season 1 · Episode 2

Dealing with "act" warning on react testing

Luis Carlos asked this on 2021-09-03

The Call Kent Podcast

September 3, 20216m 20s

Audio is streamed directly from the publisher (media.transistor.fm) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

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

Topics

reactreact-testing-libraryact