title: Make a message disappear after sometime in react
body: <p>Am currently working a react.js app and using express on the backend. Am able to fetch and display a response(message) from backend on form submission but I want it to <strong>disappear after sometime</strong>. Can someone please advise me on how to go about it. 
  I know how to this in plain javascript... 
  <strong>I want the react way.</strong> 
  Below is my code</p>
  
  <pre><code>import React, { Component } from 'react';
  import axios from 'axios';
  
  class Subscribe extends Component {
    state={
      message: ''
    }
  
    newSubscriber(newSubscriber){
      axios.post('/subscribe', newSubscriber)
      .then(res =&gt;{
        // console.log(res.data.message)
        this.setState({message: res.data.message})
      })
      .catch(err =&gt; console.log(err)
    );
    }
  
    componentDidMount(){
      setTimeout(() =&gt; this.setState({message:''}), 3000);
    }
  
    onSubmit = e =&gt; {
      e.preventDefault();
      const newSubscriber = {
        email: this.refs.email.value
      }
      this.newSubscriber(newSubscriber);
    }
    render() {
      return (
        &lt;form style={{marginTop:'20px'}} onSubmit={this.onSubmit}&gt;
          &lt;div style={{background:"green", color:"white", textAlign:"center"}}&gt;{this.state.message}&lt;/div&gt;
          &lt;div className="form-group"&gt;
            &lt;label htmlFor="email"&gt;Subscribe to get updates&lt;/label&gt;
            &lt;input type="email" ref="email" className="form-control" placeholder="Email address..." /&gt;
          &lt;/div&gt;
          &lt;button type="submit" className="btn btn-primary"&gt;Send&lt;/button&gt;
        &lt;/form&gt;
      );
    }
  }
  
  export default Subscribe
  </code></pre>
  
  <p>Thanks in advance.</p>