Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
react-in-viewport
Advanced tools
Wrapper component to detect if the component is in viewport. Use Intersection Observer API
Dependencies: Intersection Observer Polyfills
import InViewport from 'react-in-viewport';
const ViewportBlock = (props) => {
// inViewport will be passed as a props
const { inViewport } = props;
const color = inViewport ? '#217ac0' : '#ff9800';
const text = inViewport ? 'In viewport' : 'Not in viewport'
return (
<div className="viewport-block">
<h3>{ text }</h3>
<div style={{ width: '400px', height: '300px', background: color}}></div>
</div>
);
};
const Component = (props) => (
<div>
<div style={{ height: '100vh' }}>
<h2>Scroll down to make component in viewport</h2>
</div>
<InViewport>
<ViewportBlock />
</InViewport>
</div>
))
FAQs
Track React component in viewport using Intersection Observer API
The npm package react-in-viewport receives a total of 23,636 weekly downloads. As such, react-in-viewport popularity was classified as popular.
We found that react-in-viewport demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.