cara menggulir dengan lancar ke atas di reaksi js

function App() {
	const myRef = createRef()
    
    function scroll(ref) {
    	ref.current.scrollIntoView({ behavior: 'smooth' })
  	}
  
    return (
      <div className="App scrollToHere" ref={myRef}>
        Content...
        .....
        .....
        <button onClick={() => scroll(myRef)}>top</button>
      </div>
  )
}
Real Rabbit