Skip to content

Commit 064e542

Browse files
committed
update readme
1 parent fd319ad commit 064e542

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Use the hook in any functional component, the callback will be invoked
3030
when the user scrolls to the bottom of the document
3131

3232
```jsx
33-
import { useBottomScrollListener } from 'react-bottom-scroll-listener'
33+
import { useBottomScrollListener } from 'react-bottom-scroll-listener';
3434

35-
useBottomScrollListener(callback)
35+
useBottomScrollListener(callback);
3636
```
3737

3838
#### On bottom of specific container
@@ -43,11 +43,11 @@ and pass it to the element you want to use as a scroll container
4343
The callback will be invoked when the user scrolls to the bottom of the container
4444

4545
```jsx
46-
import { useBottomScrollListener } from 'react-bottom-scroll-listener'
46+
import { useBottomScrollListener } from 'react-bottom-scroll-listener';
4747

48-
const scrollRef = useBottomScrollListener(callback)
48+
const scrollRef = useBottomScrollListener(callback);
4949

50-
;<div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>
50+
<div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>
5151
```
5252

5353
**Parameters**
@@ -71,8 +71,9 @@ useBottomScrollListener(
7171
Simply have the BottomScrollListener anywhere in your application and pass it a function as `onBottom`-prop.
7272

7373
```jsx
74-
import BottomScrollListener from 'react-bottom-scroll-listener'
75-
;<BottomScrollListener onBottom={callback} />
74+
import BottomScrollListener from 'react-bottom-scroll-listener';
75+
76+
<BottomScrollListener onBottom={callback} />
7677
```
7778

7879
#### On bottom of specific container
@@ -81,8 +82,9 @@ Pass the BottomScrollListener a function inside the JSX_tag, receive the `scroll
8182
and pass it to the component you want to listen for a scroll event on.
8283

8384
```jsx
84-
import BottomScrollListener from 'react-bottom-scroll-listener'
85-
;<BottomScrollListener onBottom={callback}>
85+
import BottomScrollListener from 'react-bottom-scroll-listener';
86+
87+
<BottomScrollListener onBottom={callback}>
8688
{(scrollRef) => <div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>}
8789
</BottomScrollListener>
8890
```

0 commit comments

Comments
 (0)