
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-inview-hook
Advanced tools
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-observerimport React, { useState, useRef } from "react";
import { useInView } from "react-inview-hook";
export const SomeComponent = () => {
const [isInView, setIsInView] = useState(false);
const ref = useRef(null);
useInView({
ref,
onEnter: () => setIsInView(true),
onLeave: () => setIsInView(false)
});
return <div ref={ref}>isInView? {isInView ? "true" : "false"}</div>;
};
type UseInViewProps = {
ref: React.RefObject<Element>;
onEnter?: (entry: IntersectionObserverEntry) => void;
onLeave?: (entry: IntersectionObserverEntry) => void;
unobserveOnEnter?: boolean; // default: false
root?: React.RefObject<Element>; // default: null
rootMargin?: string; // default: '0px'
threshold?: number | number[]; // default: 0
};
FAQs
react hooks & intersection-observer
The npm package react-inview-hook receives a total of 1 weekly downloads. As such, react-inview-hook popularity was classified as not popular.
We found that react-inview-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.