title: Preview an Image selected from gallery in material-ui for react
body: <p>I am trying to make an upload button to upload image. Before submitting, I want to display the image as soon as it is selected.</p>
  
  <p>I am using material-ui library for react. Below is what I have tried, but as soon as I select a new image, the image element get destroyed from DOM.</p>
  
  <pre><code>constructor(props){
      super(props);
      this.state={
          newImage:'https://seeklogo.com/images/I/instagram-new-2016-logo-4773FE3F99-seeklogo.com.png',
      }
  }
  </code></pre>
  
  <p>.
  .
  .</p>
  
  <pre><code>&lt;Avatar
     alt="Selected Image"
     src={this.state.newImage}
     className={classes.bigAvatar}
  /&gt;
  &lt;RaisedButton
     &lt;input 
        type="file" 
        onChange = {(event,newValue) =&gt; this.setState({newImage:newValue})} 
     /&gt;
  &lt;/RaisedButton&gt;
  </code></pre>