Skip to content

Commit

Permalink
feat: add useScrolling docs
Browse files Browse the repository at this point in the history
  • Loading branch information
James committed Jun 17, 2019
1 parent 3355426 commit 25a93f6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/useScrolling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# `useScrolling`

React sensor hook that keeps track of whether the user is scrolling or not.

## Usage

```jsx
import { useScrolling } from "react-use";

const Demo = () => {
const scrollRef = React.useRef(null);
const scrolling = useScrolling(scrollRef);

return (
<div ref={scrollRef}>
{<div>{scrolling ? "Scrolling" : "Not scrolling"}</div>}
</div>
);
};
```

## Reference

```ts
useScrolling(ref: RefObject<HTMLElement>);
```

0 comments on commit 25a93f6

Please sign in to comment.