Ask questionsBug: Warning: unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering if debugger present

If a debugger is present in the main body of a functional component then on hitting the debugger and proceeding from there an unstable_flushDiscreteUpdates warning is thrown.

React version: ^16.13.1

Steps To Reproduce

  1. Clone
  2. Put a debugger right above the React.useEffect() in the DiscoverBooksScreen Component
  3. Hit the debugger break point and resume execution of code
  4. unstable_flushDiscreteUpdates warning is thrown in the console.

Link to code example:

The current behavior

unstable_flushDiscreteUpdates warning is thrown in the console

The expected behavior

unstable_flushDiscreteUpdates warning should not be thrown in the console

Untitled Untitled2


Answer questions kentcdodds

And it's not just something weird about the bookshelf app as @SangeetAgarwal notes:

I was able to reproduce this issue in an app written a couple of years back that used class components too

Kent C. Dodds kentcdodds @kentcdodds Salt Lake City, Utah, USA Improving the world w/ quality software · Husband, Father, Latter-day Saint, Teacher, OSS · · http://EpicReact.Dev · Be Kind
Github User Rank List