Socket
Socket
Sign inDemoInstall

react-intersection-observer

Package Overview
Dependencies
Maintainers
1
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intersection-observer - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1-0

2

index.d.ts

@@ -69,2 +69,2 @@ import { RenderProps } from 'react-intersection-observer'

export default Component
export default Component
{
"name": "react-intersection-observer",
"version": "4.0.0",
"version": "4.0.1-0",
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",

@@ -28,3 +28,3 @@ "main": "lib/index.js",

"precommit": "flow && lint-staged",
"postcommit": "git reset",
"postcommit": "git update-index --again",
"prepare": "npm run build",

@@ -36,6 +36,10 @@ "pretty": "prettier '**/*.{js,md,json}' --write",

"lint-staged": {
"*.js": [
"prettier --write --no-semi --single-quote --trailing-comma all",
"*.{js,json,css,md,ts}": [
"prettier --write",
"git add"
],
"src/**/*.js": [
"eslint",
"git add"
"jest --findRelatedTests",
"flow force-recheck --focus"
]

@@ -96,7 +100,3 @@ },

"request": "~2.85.0"
},
"resolutions": {
"react": "^16.2.0",
"react-dom": "^16.2.0"
}
}

@@ -61,3 +61,3 @@ # react-intersection-observer

| **rootMargin** | String | '0px' | false | Margin around the root. Can have values similar to the CSS margin property, e.g. "10px 20px 30px 40px" (top, right, bottom, left). |
| **tag** | String | 'div' | false | Element tag to use for the wrapping component |
| **tag** | String | 'div' | false | Element tag to use for the wrapping element when rendering using 'children'. Defaults to 'div' |
| **threshold** | Number | 0 | false | Number between 0 and 1 indicating the the percentage that should be visible before triggering. Can also be an array of numbers, to create multiple trigger points. |

@@ -67,7 +67,7 @@ | **triggerOnce** | Bool | false | false | Only trigger this method once |

## Examples
## Usage
### Child as function
The default way to use the `Observer`, is to pass a function as the child. It
The easiest way to use the `Observer`, is to pass a function as the child. It
will be called whenever the state changes, with the new value of `inView`.

@@ -112,3 +112,3 @@ By default it will render inside a `<div>`, but you can change the element by setting `tag` to the HTMLElement you need.

You can monitor the onChange method, and control the state in your own
component. The child node will always be rendered.
component.

@@ -127,3 +127,2 @@ ```js

### Polyfill for intersection-observer

@@ -179,2 +178,2 @@

}
```
```

@@ -7,3 +7,3 @@ // @flow

type Props = {
/** Element tag to use for the wrapping */
/** Element tag to use for the wrapping element when rendering using 'children'. Defaults to 'div' */
tag: string,

@@ -10,0 +10,0 @@ /** Only trigger the inView callback once */

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