Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 442 Bytes

useScrollPosition.md

File metadata and controls

31 lines (21 loc) · 442 Bytes

useScrollPosition

Simple hook that tracks scroll position

Usage

import { useScrollPosition } from 'use-haki';

const App = () => {
  const scrollPosition = useScrollPosition();

  return (
    <div>
      <span>scroll position: {scrollPosition}</span>
    </div>
  );
};

Reference

const scrollPosition = useScrollPosition();
  • scrollPosition - gives scroll position

Returns

  • scrollPosition