A lightweight (1 kB) package to easily track scroll percentage in React.js
npm install react-scroll-level
import React from 'react'
import { useScrollLevel } from 'react-scroll-level'
function App() {
const { scrollHeight, scrollWidth } = useScrollLevel();
console.log('scrollHeight:', scrollHeight);
console.log('scrollWidth:', scrollWidth);
}