title: Dismiss react error messages after a timeout
body: <p>I am trying to display some react error messages and hide them after a timeout of 5 seconds. Below is the code:</p>
  
  <pre><code>import * as React from 'react'
  import {ErrorInfo} from '../Twilio/api'
  export const Error = ({type, message, visible}: ErrorInfo) =&gt; (
      // visible=true,
      setTimeout(function () {
          visible = false
      }, 5000),
          visible ?
              &lt;div&gt;
                  &lt;p&gt;
                      &lt;strong&gt;{type}:&lt;/strong&gt; {message}
                      &lt;br/&gt;
                      &lt;small&gt;
                          UI version: &lt;code&gt;{GLOBAL_VERSION}&lt;/code&gt;
                      &lt;/small&gt;
                  &lt;/p&gt;
              &lt;/div&gt; : &lt;span/&gt;
  )
  </code></pre>
  
  <p><code>ErrorInfo</code> is as follows:</p>
  
  <pre><code>export type ErrorInfo = {
      type: string
      message: string
      visible: boolean
  }
  </code></pre>
  
  <p>However, <code>visible</code> is being set to undefined and therefore error message is not getting displayed. If I set it to true while exporting <code>Error</code>, then it is getting displayed by the <code>Header</code> element is not getting removed when <code>visible</code> becomes false.</p>