Skip to content

Commit 2176d5a

Browse files
authored
Merge pull request #1 from joshwnj/master
pull latest changes
2 parents c7e7b73 + b32ab63 commit 2176d5a

File tree

5 files changed

+6295
-5046
lines changed

5 files changed

+6295
-5046
lines changed

.babelrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["env", "react"],
3-
"plugins": ["transform-class-properties"]
4-
}
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": ["@babel/plugin-proposal-class-properties"]
4+
}

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
Changelog
2-
====
1+
# Changelog
2+
3+
## 5.1.1
4+
5+
- Upgrade outdated dependencies to resolve vulnerabilities ([#162](https://github.com/joshwnj/react-visibility-sensor/pull/162))
6+
7+
## 5.1.0
8+
9+
- Add TypeScript definition ([#153](https://github.com/joshwnj/react-visibility-sensor/pull/153))
310

411
## 5.0.0
512

@@ -111,7 +118,7 @@ Changelog
111118

112119
If you're not setting a `className` or `style`, no change is required.
113120

114-
Otherwise add your own element as a child and move the `className` or `style` there. Eg:
121+
Otherwise add your own element as a child and move the `className` or `style` there. Eg:
115122

116123
- before: `<VisibilitySensor className='something' />`
117124
- after: `<VisibilitySensor><div className='something' /></VisibilitySensor>`

index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
declare module "react-visibility-sensor" {
2+
import * as React from "react";
3+
4+
interface Shape {
5+
top?: number;
6+
left?: number;
7+
bottom?: number;
8+
right?: number;
9+
}
10+
11+
interface Props {
12+
onChange?: (isVisible: boolean) => void;
13+
active?: boolean;
14+
partialVisibility?: boolean;
15+
offset?: Shape;
16+
minTopValue?: number;
17+
intervalCheck?: boolean;
18+
intervalDelay?: number;
19+
scrollCheck?: boolean;
20+
scrollDelay?: number;
21+
scrollThrottle?: number;
22+
resizeCheck?: boolean;
23+
resizeDelay?: number;
24+
resizeThrottle?: number;
25+
containment?: any;
26+
delayedCall?: boolean;
27+
children?:
28+
| React.ReactNode
29+
| ((
30+
args: { isVisible: boolean; visibilityRect?: Shape }
31+
) => React.ReactNode);
32+
}
33+
34+
const ReactVisibilitySensor: React.StatelessComponent<Props>;
35+
36+
export default ReactVisibilitySensor;
37+
}

0 commit comments

Comments
 (0)