title: Warning: setState(...): Cannot update during an existing state transition
body: <p>I'm getting the following error:</p>
  
  <pre><code>Warning: setState(...): Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to `componentWillMount`.
  </code></pre>
  
  <p>My component:</p>
  
  <pre><code>import React from 'react';
  import { Redirect } from 'react-router'
  import Notifications from 'react-notification-system-redux';
  
    constructor(props) {
      super(props);
      this.state = {
        invite_token: this.props.match.params.token,
        FormSubmitSucceeded: false,
        inviteRequestSubmitSucceeded: false
      };
    }
  
    ....
  
    inviteAlreadyUsed() {
      const notificationOpts = {
        message: 'Invitation already used!',
      };
      this.props.createNotificationSuccess(notificationOpts);
    }
  
    render() {
      const { invite } = this.props;
  
      if (invite &amp;&amp; invite.status === "completed") {
        this.inviteAlreadyUsed();
        return &lt;Redirect to={{ pathname: '/' }}/&gt;;
      }
  
    ...
  </code></pre>
  
  <p>Any suggestions on how to avoid this warning? Is this not how you would handle a redirect?</p>