React hook for smooth scrolling
npm install use-smooth-scroll-toReact hook for smooth scrolling




``bash`npm
npm i use-smooth-scroll-toyarn
yarn add use-smooth-scroll-topnpm
pnpm i use-smooth-scroll-to
`tsx
import { useRef } from "react";
import { useScroll } from "use-smooth-scroll-to";
function App() {
const { scroll } = useScroll({ easing: "easeInCirc" });
const divRef = useRef(null);
return (
export default App;
`
| Property | Type | required | Description |
| --------------- | --------------------------------- | -------- | ---------------------------------------------------------------- |
| useNativeScroll | boolean | false | Use window.scrollTo` for scrolling |
| easing | ((x: number) => number) \| string | false | Your own easing function or name of implemented easing functions |
- linear
- easeInSine
- easeInCubic
- easeInQuint
- easeInCirc
- easeOutSine
- easeOutCubic
- easeOutQuint
- easeOutCirc
- easeInOutSine
- easeInOutCubic
- easeInOutQuint
- easeInOutCirc