title: Hold button to scroll continuously ReactJS
body: <p>i have two buttons left and right to a div, this div has a scroll bar 
  and all i want to do is , when holding one the the buttons for 1000ms .. the scrollbar moves continously (Like the default implementation in our browsers)
  i know how to use setTimeout! but the problem is inside the function </p>
  
  <p>Inside the class</p>
  
  <pre><code>holdRightButton = () =&gt; {
       // i want to use this element :
       // const slider : HTMLElement = this.state.scrollRef.current;
       this.setState({
          timer : setTimeout(() =&gt; {
  
          }, 1000)
        })
      }
  releaseButton = () =&gt; {
      clearTimeout(this.state.timer);
  }
  </code></pre>
  
  <p>Inside render():</p>
  
  <pre><code>&lt;Button onMouseDown={this.holdRightButton}
  onMouseUp={this.releaseButton}&gt;
            &lt;span className="fas fa-chevron-right" /&gt; 
  &lt;/Button&gt;
  </code></pre>
  
  <p>i tried to do for example Element.ScrollBy(1, 0) but you know .. it will execute it only 1 time 
  i also tried a boolean that turns to False when event onMouseUp is sent but the application crashes
  Any solution ? even if it is totally different</p>