1.2.0 • Published 1 year ago

use-react-scroll-to v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

React hook scroll to any component

Built to be used with create-react-app, nextjs, gatsby, or react-static.

See it in demo

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>
    )
}
1.2.0

1 year ago

1.1.0

1 year ago

0.1.0

1 year ago