title: React Route Warning: Cannot update a component (`App`) while rendering a different component (`Context.Consumer`)
body: <p>I have privateRoute. When user is not signed in or email is not verified, redirect to modal login with warning. it is run by function show modal but i get error.
  it is work, by it is show this errror in dev.
  in prod i dont get this error.</p>
  <p>warning:</p>
  <blockquote>
  <p>index.js:1 Warning: Cannot update a component (<code>App</code>) while rendering
  a different component (<code>Context.Consumer</code>). To locate the bad
  setState() call inside <code>Context.Consumer</code>, follow the stack trace as
  described in
  in Route (at PrivateRoute.js:13)
  in PrivateRoute (at App.js:217)
  in Switch (at App.js:196)
  in Router (created by BrowserRouter)
  in BrowserRouter (at App.js:140)
  in div (at App.js:139)
  in App (at src/index.js:11)
  in Provider (at src/index.js:10)</p>
  </blockquote>
  <p>code:</p>
  <pre><code>  &lt;Route
    {...rest}
    render={(props) =&gt;
      (user &amp;&amp; user.providerId &amp;&amp; user.providerId !== 'password') ||
      (user &amp;&amp;
        user.providerId &amp;&amp;
        user.providerId === 'password' &amp;&amp;
        user.emailVerified) ? (
        &lt;Component {...props} /&gt;
      ) : (
        &lt;Redirect to=&quot;/&quot;&gt;{setLoginModalShow(true)}&lt;/Redirect&gt;
      )
    }
  /&gt;
  </code></pre>
  <p>how i shoud do this corect
  please help</p>