anchorate

1.2.4 • Public • Published

anchorate

Scroll to anchor links.

Scroll to anchor links with client-side routes e.g. with history's listen, React Router's onUpdate, or Gatsby's onRouteChange. Register a listener to call this and when window.location.hash isn't empty, it'll scrollIntoView first matching element by id or name per spec.

Originally based on: https://github.com/reactjs/react-router/issues/394#issuecomment-220221604.

See docs at https://andersdjohnson.github.io/anchorate/.

Used By

Readme

Keywords

none

Package Sidebar

Install

npm i anchorate

Weekly Downloads

129

Version

1.2.4

License

ISC

Unpacked Size

3.99 kB

Total Files

4

Last publish

Collaborators

  • andersdjohnson