Usage with React
@scroom/react provides hooks to simplify usage.
Installation
$ npm install @scroom/react
Usage
import { useScroom, useDebug } from "@scroom/react";import { useRef, useEffect } from "react";function App() {const ref = useRef();const sc = useScroom(ref, {offset: 0.5,onProgress(e) {console.log(e.progress);},});// if you want to debuguseDebug(sc);return <div ref={ref}>...</div>;}