Skip to content

Commit 6dfc039

Browse files
committed
Add triggerOnNoScroll to component as well
1 parent 63ff1f7 commit 6dfc039

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/component/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ export interface Props {
2323
*/
2424
debounceOptions?: DebounceOptions
2525

26+
/**
27+
* Triggers the onBottom callback when the page has no scrollbar, defaults to false
28+
*/
29+
triggerOnNoScroll: boolean
30+
2631
/**
2732
* Optional children to be rendered.
2833
*
@@ -37,8 +42,8 @@ export interface Props {
3742
/**
3843
* A simple React component that lets you listen for when you have scrolled to the bottom.
3944
*/
40-
const BottomScrollListener = ({ children, onBottom, offset, debounce, debounceOptions }: Props): JSX.Element | null => {
41-
const optionalScrollContainerRef = useBottomScrollListener(onBottom, offset, debounce, debounceOptions)
45+
const BottomScrollListener = ({ children, onBottom, offset, debounce, debounceOptions, triggerOnNoScroll }: Props): JSX.Element | null => {
46+
const optionalScrollContainerRef = useBottomScrollListener(onBottom, offset, debounce, debounceOptions, triggerOnNoScroll)
4247

4348
if (!children) return null
4449
else if (typeof children === 'function') return children(optionalScrollContainerRef)

0 commit comments

Comments
 (0)