New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-bottom-scroll-listener

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bottom-scroll-listener - npm Package Compare versions

Comparing version 4.1.0 to 4.1.1

2

dist/component/index.d.ts

@@ -23,3 +23,3 @@ import React from 'react';

*/
triggerOnNoScroll: boolean;
triggerOnNoScroll?: boolean;
/**

@@ -26,0 +26,0 @@ * Optional children to be rendered.

{
"name": "react-bottom-scroll-listener",
"version": "4.1.0",
"version": "4.1.1",
"description": "A simple React component that lets you listen for when you have scrolled to the bottom.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/karl-run/react-bottom-scroll-listener",

@@ -33,5 +33,5 @@ # react-bottom-scroll-listener ![npm](https://img.shields.io/npm/dm/react-bottom-scroll-listener.svg) [![NPM version](https://img.shields.io/npm/v/react-bottom-scroll-listener.svg?style=flat)](https://www.npmjs.com/package/react-bottom-scroll-listener) [![npm bundle size (minified)](https://img.shields.io/bundlephobia/minzip/react-bottom-scroll-listener.svg)](https://github.com/karl-run/react-bottom-scroll-listener)

```jsx
import { useBottomScrollListener } from 'react-bottom-scroll-listener';
import { useBottomScrollListener } from 'react-bottom-scroll-listener'
useBottomScrollListener(callback);
useBottomScrollListener(callback)
```

@@ -47,7 +47,7 @@

```jsx
import { useBottomScrollListener } from 'react-bottom-scroll-listener';
import { useBottomScrollListener } from 'react-bottom-scroll-listener'
const scrollRef = useBottomScrollListener(callback);
const scrollRef = useBottomScrollListener(callback)
<div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>
;<div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>
```

@@ -59,5 +59,7 @@

useBottomScrollListener(
onBottom, // Required callback that will be invoked when scrolled to bottom
offset = 0, // Offset from bottom of page in pixels. E.g. 300 will trigger onBottom 300px from the bottom of the page
debounce = 200, // Optional debounce in milliseconds, defaults to 200ms
onBottom, // Required callback that will be invoked when scrolled to bottom
offset = 0, // Offset from bottom of page in pixels. E.g. 300 will trigger onBottom 300px from the bottom of the page
debounce = 200, // Optional debounce in milliseconds, defaults to 200ms
debounceOptions, // Overwrite the debounceOptions for lodash.debounce, default to { leading: true }
triggerOnNoScroll,// If container is too short, enables a trigger of the callback if that happens, defaults to false
) // returns React.MutableRefObject Optionally you can use this to pass to a element to use that as the scroll container

@@ -75,5 +77,4 @@ ```

```jsx
import BottomScrollListener from 'react-bottom-scroll-listener';
<BottomScrollListener onBottom={callback} />
import BottomScrollListener from 'react-bottom-scroll-listener'
;<BottomScrollListener onBottom={callback} />
```

@@ -87,8 +88,5 @@

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

@@ -105,8 +103,10 @@ ```

| Property | Type | Default | Description |
| -------- | :----------------------: | :-----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onBottom | Function | null | **(required):** callback invoked when bottom is reached |
| debounce | number | 200 | milliseconds, how much debounce there should be on the callback |
| offset | number | 0 | offset from bottom in pixels. E.g. 300 if it should invoke `onBottom` 300px before the bottom. |
| children | React.Node _or_ Function | null | Not required, but you can use this to wrap your components. Most useful when you have some conditional rendering. If this is a function, that function will receive a React.RefObject that _needs_ to be passed to a child element. This element will then be used as the scroll container. |
| Property | Type | Default | Description |
| ----------------- | :----------------------: | :-------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onBottom | Function | null | **(required):** callback invoked when bottom is reached |
| debounce | number | 200 | milliseconds, how much debounce there should be on the callback |
| offset | number | 0 | offset from bottom in pixels. E.g. 300 if it should invoke `onBottom` 300px before the bottom. |
| debounceOptions | DebounceOptions | {leading: true} | see the lodash.debounce options: see https://lodash.com/docs/4.17.15#debounce |
| triggerOnNoScroll | boolean | false | if container is too short, enables a trigger of the callback if that happens |
| children | React.Node _or_ Function | null | Not required, but you can use this to wrap your components. Most useful when you have some conditional rendering. If this is a function, that function will receive a React.RefObject that _needs_ to be passed to a child element. This element will then be used as the scroll container. |

@@ -113,0 +113,0 @@ # Migrating from 2.x.x to 3.x.x

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc