title: React - setState(...): Can only update a mounted or mounting component
body: <p>I am getting the <code>setState</code> error when inside a secondary component using react-router. Can anyone see any issues in my code?</p>
  
  <pre><code>import React, { Component } from 'react';
  import { Row, Col } from 'react-bootstrap';
  import { Card, CardTitle, CardText } from 'material-ui/Card';
  import './App.css';
  
  class Dashboard extends Component {
    constructor(props) {
      super(props);
      this.state = {
        info: []
      };
      this.setInfo = this.setInfo.bind(this);
  
      this.setInfo();
    }
  
    setInfo = () =&gt; {
      var info = [
        {
          id: 0,
          title: 'Server Space',
          subtitle: '',
          textContent: ''
        },
        {
          id: 1,
          title: 'Pi Space',
          subtitle: '',
          textContent: ''
        }
      ];
      this.setState({ info: info });
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;h2&gt;Info&lt;/h2&gt;
          &lt;Row&gt;
            {this.state.info.map((inf) =&gt; {
              return (
                &lt;Col xs={12} md={4} key={inf.id}&gt;
                  &lt;Card className="card"&gt;
                    &lt;CardTitle title={inf.title} subtitle={inf.subtitle} /&gt;
                    &lt;CardText&gt;{inf.textContent}&lt;/CardText&gt;
                  &lt;/Card&gt;
                &lt;/Col&gt;
              )
            })}
          &lt;/Row&gt;
        &lt;/div&gt;
      )
    }
  }
  
  export default Dashboard;
  </code></pre>
  
  <p>This results in:</p>
  
  <pre><code>Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Dashboard component.
  </code></pre>
  
  <p>The line in question is <code>this.setState({ info: info });</code></p>