The reason for this issue should be, calling the setState({}) function continuously.
For example,
consider the below code snippet from class component,
class MyComponent() {
componentDidUpdate() {
this.setState({ someStateVariable: someValue })
}
}
This is one of the places where the setState({}) will be called again and again.
If you are using functional component, check the useEffect(() => {}) function carefully and avoid state update inside useEffect(()=> {}), without any conditions. Also avoid any state update outside of any functions.
For example,
const MyFunction(props) => {
useEffect(()=> {
setSomeStateVariable(someValue);
});
}
This is the open useEffect without any parameter which will be called every change in the component, So we cannot use state update here without wrapping up with any conditions.
Also, check for any child component that updates its local state or parent state variable continuously.
Try to avoid using multiple useEffect(()=> {}), in a functional component.