Gathering detailed insights and metrics for react-inview-hook
Gathering detailed insights and metrics for react-inview-hook
Gathering detailed insights and metrics for react-inview-hook
Gathering detailed insights and metrics for react-inview-hook
react-hook-inview
React Hook for detecting when an element is in the viewport
react-cool-inview
React hook to monitor an element enters or leaves the viewport (or another element).
@1stmmd/react-in-view-hook
just a hook who when used return a ref and inView variable
target-observer
With Target Observer, you can easily trigger animations, lazy load content, or handle visibility-based logic in your application.
npm install react-inview-hook
Typescript
Module System
Node Version
NPM Version
72
Supply Chain
85.7
Quality
75.3
Maintenance
100
Vulnerability
100
License
TypeScript (88.33%)
JavaScript (8.05%)
HTML (3.62%)
Total Downloads
5,941
Last Day
1
Last Week
2
Last Month
14
Last Year
225
1 Stars
33 Commits
1 Watching
21 Branches
1 Contributors
Latest Version
0.1.0
Package Id
react-inview-hook@0.1.0
Unpacked Size
30.33 kB
Size
5.20 kB
File Count
26
NPM Version
6.10.2
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last day
-83.3%
1
Compared to previous day
Last week
-80%
2
Compared to previous week
Last month
250%
14
Compared to previous month
Last year
-76.7%
225
Compared to previous year
react-hooks with intersection-observer.
This module will cache IntersectionObservers (group by IntersectionObserverInit).
That's reason is performance on IE11 with polyfill.
This module uses Map
and IntersectionObserver
If you use this in es5 environment, should install polyfills below.
Map
@babel/polyfill
or es6-map
etc.IntersectionObserver
intersection-observer
1import React, { useState, useRef } from "react"; 2import { useInView } from "react-inview-hook"; 3 4export const SomeComponent = () => { 5 const [isInView, setIsInView] = useState(false); 6 const ref = useRef(null); 7 8 useInView({ 9 ref, 10 onEnter: () => setIsInView(true), 11 onLeave: () => setIsInView(false) 12 }); 13 14 return <div ref={ref}>isInView? {isInView ? "true" : "false"}</div>; 15};
1type UseInViewProps = { 2 ref: React.RefObject<Element>; 3 4 onEnter?: (entry: IntersectionObserverEntry) => void; 5 6 onLeave?: (entry: IntersectionObserverEntry) => void; 7 8 unobserveOnEnter?: boolean; // default: false 9 10 root?: React.RefObject<Element>; // default: null 11 12 rootMargin?: string; // default: '0px' 13 14 threshold?: number | number[]; // default: 0 15};
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
82 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More