title: how to solve error: Minified React error #185; visit https://reactjs.org/docs/error-decoder.html?invariant=185
body: <p>Minified React error #185; visit <a href="https://reactjs.org/docs/error-decoder.html?invariant=185" rel="nofollow noreferrer">https://reactjs.org/docs/error-decoder.html?invariant=185</a> for the full message or use the non-minified dev environment for full errors and additional helpful warnings.</p>
  <p>I've got this error when deployment</p>
  <p>I heard this error can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate.</p>
  <p>But in my component I don't have componentWillUpdate and componentDidUpdate.</p>
  <p>why is it happening in my component?</p>
  <p>this is my state init.</p>
  <pre><code> constructor(props) {
      super(props);
      this.state = {
        isLoggedIn: false,
        loading:false,
        username:&quot;&quot;,
        password:&quot;&quot;,
        message:&quot;&quot;,
        alert:{
        open: false,
        type: &quot;&quot;,
        message: &quot;&quot;
      }
      this.handleClose = this.handleClose.bind(this);
      this.handleChange = this.handleChange.bind(this);
      this.handleFormSubmit = this.handleFormSubmit.bind(this);
  </code></pre>
  <p>and this is my handlers</p>
  <pre><code>handleClose(event, reason){
        if (reason === &quot;clickaway&quot;) {
          return;
        }
        this.setState(prevState =&gt; ({
          alert: {
            ...prevState.alert, open:false
          }
        }));
    
    }
    
    handleFormSubmit(e) {
      e.preventDefault();
      this.setState({loading:true})
      this.Auth.login(this.state.username, this.state.password)
        .then((res) =&gt; {
          if(res.status == 200){
            localStorage.setItem(&quot;username&quot;, this.state.username);          
            var ec2Ready = setInterval(()=&gt;{
              this.Auth.checkStatus(this.state.username)
              .then((res)=&gt;{
                  if(res.ready == true){
                    this.setState({loading:false, isLoggedIn:true})
                    clearInterval(ec2Ready)
                  }else{
                    this.setState(prevState=&gt;({
                      ...prevState, message: res.msg
                    }))
                  }
              })
            }, 8000)
          }else{  
            this.setState({
              loading:false,
              alert:{ open: true, message:res.err, type:&quot;error&quot;}
          });
          
          }      
        })
        .catch((err) =&gt; {
          this.setState({
            loading:false,
            alert:{ open: true, message:err.response.statusText, type:&quot;error&quot;}
        });
    })
    
  }
  
    handleChange(e) {
      this.setState({
        [e.target.name]: e.target.value,
      });
    }
  }
  </code></pre>