MCPcopy Create free account
hub / github.com/reactjs/react-rails / checkForNestedUpdates

Function checkForNestedUpdates

lib/assets/react-source/development/react.js:26781–26800  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26779 }
26780
26781 function checkForNestedUpdates() {
26782 if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
26783 nestedUpdateCount = 0;
26784 rootWithNestedUpdates = null;
26785
26786 {
26787 {
26788 throw Error( "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." );
26789 }
26790 }
26791 }
26792
26793 {
26794 if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
26795 nestedPassiveUpdateCount = 0;
26796
26797 error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
26798 }
26799 }
26800 }
26801
26802 function flushRenderPhaseStrictModeWarningsInDEV() {
26803 {

Callers 1

scheduleUpdateOnFiberFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected