React component that adds a 'scroll to top' button fixed on the bottom of the page and shown if not scrolled up.
You can try it out in a demo on Codesandbox.
Install the package with either yarn or npm.
With yarn:
yarn add @nzambello/react-scrolltopWith npm:
npm install --save @nzambello/react-scrolltopimport React from 'react'
import ReactDOM from 'react-dom'
import ScrollTop from '@nzambello/react-scrolltop'
const App = () => (
  ...
  <ScrollTop />
)
ReactDOM.render(<App />, document.getElementById('root'))