title: Make scroll to top button with animation in React
body: <p>I wanna add button, by clicking on which page will be scrolled back to the top with animation. I know how to realize that using JQuery. I tried this code:</p>
  
  <pre><code>import React, { Component } from 'react';
  
  import $ from 'jquery';
  
  import goUpNarrrowImage from '../static/img/goUpNarrow.png';
  
  class GoTopButton extends Component {
    constructor() {
      super();
  
      this.onclick = this.onclick.bind(this);
    }
  
    render() {
  
      return ( 
        &lt;button&gt;
          &lt;img src={goUpNarrrowImage} style={{
            display: "inline-block",
            marginRight: "10px"
          }} /&gt;
          наверх
        &lt;/button&gt;
      );
    }
  
    onclick() {
      $("html, body").animate({ scrollTop: 0 }, 1000);
    }
  }
  
  export default GoTopButton;
  </code></pre>
  
  <p>But when I click the button nothing happens.</p>