react-scroll-percentage
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -124,3 +124,4 @@ 'use strict'; | ||
threshold = _props.threshold, | ||
props = _objectWithoutProperties(_props, ['children', 'threshold']); | ||
onChange = _props.onChange, | ||
props = _objectWithoutProperties(_props, ['children', 'threshold', 'onChange']); | ||
@@ -127,0 +128,0 @@ return React.createElement( |
{ | ||
"name": "react-scroll-percentage", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Monitor the scroll percentage of a component inside the viewport, using the IntersectionObserver API.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -108,3 +108,3 @@ # react-scroll-percentage | ||
| --------- | --------- | ------- | -------- | --------------------------------------------------------------------------------------------- | | ||
| tag | String | | false | Element tag to use for the wrapping component | | ||
| tag | Node | | false | Element tag to use for the wrapping component | | ||
| children | func/node | | false | Children should be either a function or a node | | ||
@@ -119,3 +119,3 @@ | threshold | Number | 0 | false | Number between 0 and 1 indicating the the percentage that should be visible before triggering | | ||
The basic usage pass a function as the child. It will be called whenever the | ||
state changes, with an object containing `inView` and `percentage`. | ||
state changes, with the current value of `percentage` and `inView`. | ||
@@ -122,0 +122,0 @@ ```js |
@@ -10,7 +10,7 @@ // @flow | ||
/** Children should be either a function or a node */ | ||
children?: React.Node | ((percentage: number, inView: boolean) => React.Node), | ||
children: React.Node | ((percentage: number, inView: boolean) => React.Node), | ||
/** Call this function whenever the percentage changes */ | ||
onChange?: (percentage: number, inView: boolean) => void, | ||
/** Number between 0 and 1 indicating the the percentage that should be visible before triggering */ | ||
threshold: number, | ||
threshold?: number, | ||
} | ||
@@ -131,3 +131,3 @@ | ||
render() { | ||
const { children, threshold, ...props } = this.props | ||
const { children, threshold, onChange, ...props } = this.props | ||
@@ -134,0 +134,0 @@ return ( |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
287141
347
0