
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
@futurejj/react-native-visibility-sensor
Advanced tools
A React Native wrapper to check whether a component is in the view port to track impressions and clicks
🔍 Component visibility sensor wrapper to sense whether or not a component is in viewport with configurable inset thresholds.
Using yarn
yarn add @futurejj/react-native-visibility-sensor
using npm:
npm install @futurejj/react-native-visibility-sensor
import React from 'react';
import { ScrollView, Text } from 'react-native';
import { VisibilitySensor } from '@futurejj/react-native-visibility-sensor';
export default function VisibilitySensorExample() {
const [isInView, setIsInView] = React.useState(false);
function checkVisible(isVisible: boolean) {
if (isVisible) {
setIsInView(isVisible);
} else {
setIsInView(isVisible);
}
}
return (
<ScrollView>
<VisibilitySensor
onChange={(isVisible) => checkVisible(isVisible)}
threshold={{
left: 100,
right: 100,
}}
style={[styles.item, { backgroundColor: isInView ? 'green' : 'red' }]}>
<Text>This View is currently visible? {isInView ? 'yes' : 'no'}</Text>
</VisibilitySensor>
</ScrollView>
);
}
VisibilitySensorProps extends ViewProps from React Native, which includes common properties for all views, such as style, onLayout, etc.
| Property | Type | Required | Description |
|---|---|---|---|
| onChange | (visible: boolean) => void | Yes | Callback function that fires when visibility changes. |
| disabled | boolean | No | If true, disables the sensor. |
| triggerOnce | boolean | No | If true, the sensor will only trigger once. |
| delay | number | undefined | No | The delay in milliseconds before the sensor triggers. |
| threshold | VisibilitySensorThreshold | No | Defines the part of the view that must be visible for the sensor to trigger. |
Additionally, all properties from ViewProps are also applicable.
| Property | Type | Required | Description |
|---|---|---|---|
| top | number | No | The top threshold value for visibility. |
| bottom | number | No | The bottom threshold value for visibility. |
| left | number | No | The left threshold value for visibility. |
| right | number | No | The right threshold value for visibility. |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
A React Native wrapper to check whether a component is in the view port to track impressions and clicks
The npm package @futurejj/react-native-visibility-sensor receives a total of 16,745 weekly downloads. As such, @futurejj/react-native-visibility-sensor popularity was classified as popular.
We found that @futurejj/react-native-visibility-sensor demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.