1.2.0 • Published 1 year ago
use-react-scroll-to v1.2.0
React hook scroll to any component
Built to be used with create-react-app, nextjs, gatsby, or react-static.
import and how to use
import { useScroll } from "use-react-scroll-to";
export default () => {
const { scrollTo } = useScroll();
return (
<div>
<button onClick={() => scrollTo({ elementId: "element id", behavior: "auto" })}>go t</button
</div>
)
}