Skip to content

Commit

Permalink
fix based on SvanBoxel#4
Browse files Browse the repository at this point in the history
  • Loading branch information
ddikodroid authored Mar 30, 2022
1 parent b57ae12 commit 9a03cc5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface Props {

const VisibilitySensor: React.FC<Props> = (props) => {
const myView: any = useRef(null);
const [lastValue, setLastValue] = useState<boolean>(false);
const [lastValue, setLastValue] = useState<boolean>(null);
const [dimensions, setDimensions] = useState<IDimensionData>({
rectTop: 0,
rectBottom: 0,
Expand All @@ -26,7 +26,6 @@ const VisibilitySensor: React.FC<Props> = (props) => {
let interval: any = null;

useEffect(() => {
setLastValue(false);
startWatching();
isInViewPort();
return stopWatching;
Expand Down

0 comments on commit 9a03cc5

Please sign in to comment.