import React, { useRef } from 'react'; import './App.css'; import { useConveyer } from './react-conveyer/useConveyer'; function App() { const ref = useRef(null) as any as ((e: HTMLElement | null) => void) & { current: HTMLElement | null }; const { isReachStart, isReachEnd, scrollIntoView, onBeginScroll, onFinishScroll, } = useConveyer(ref, { preventClickOnDrag: true, horizontal: false, }); onBeginScroll(() => { console.log("begin scroll"); }, []); onFinishScroll(() => { console.log("finish scroll"); }, []); return (
1
2
3
4
5
6
7
8
9
10
11
12
); } export default App;