
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
react-native-swiper-parallax
Advanced tools
react-native-swiper-parallax is a swiper component for React Native featuring paging and an optional parallax effect. Compatible with Android & iOS.
npm install react-native-swiper-parallax --save
Content and delayed content are being passed as render props.
import Slider from 'react-native-swiper-parallax';
class MyComponent extends Component {
renderContent = content => {
return (
<Content>
<Text>content</Text>
</Content>
);
};
renderDelayedContent = content => {
return (
<DelayedContent>
<Text>{content.title}</Text>
</DelayedContent>
);
};
render() {
return (
<Slider
slides={slides}
renderContent={this.renderContent}
renderDelayedContent={this.renderDelayedContent}
delayFactor={0.3}
triggeringThreshold={0}>
{(slideCount, currentIndex, nextIndex, requestSlideIndex) => (
<Fragment>
<PagingContainer>
<Paging
slideCount={slideCount}
currentSlideIndex={currentIndex}
currentControlColor={colors.mainOrange}
defaultControlColor="rgba(46, 43, 43, 0.25)"
/>
</PagingContainer>
<BottomBar
swipe={() => requestSlideIndex(currentIndex, currentIndex + 1)}
/>
</Fragment>
)}
</Slider>
);
}
}
The Slider component is using React context api. It has a provider and every child which uses the HOC withSliderContext has access to the Slider store which is shown below.
const SliderContext = createContext({
currentIndex: null,
nextIndex: null,
setCurrentIndex: () => {},
setNextIndex: () => {},
slideCount: null,
});
The Slider itself is inside the provider and has therefore access to an action which sets the next index before the animation is triggered. The Paging component while being connected to the Slider store is aware of any index change in real time. Slider has a shouldComponentUpdate method which prevents the component from re rendering when the nextIndex is set:
shouldComponentUpdate(nextProps: OwnProps) {
return this.props.nextIndex === nextProps.nextIndex;
}
| Props | Params | Returns | Description |
|---|---|---|---|
| slides | content delayedContent | none | Array of slides with a content and a delayed content |
| renderContent | content | jsx | Render all slides main content |
| renderDelayedContent | content | jsx | Render all slides delayed content for parallax effect |
| delayFactor | none | none | Number to delay the sliding animation |
| OwnProps | Params | Returns | Description |
|---|---|---|---|
| currentIndex | none | none | Slider current index |
| nextIndex | none | none | Slider next index before animation is triggered |
| setCurrentIndex | index | none | Set current index |
| setNextIndex | index | none | Set next index |
| slideCount | none | none | Number of slides |
FAQs
swiper with a parallax effect for react native
The npm package react-native-swiper-parallax receives a total of 16 weekly downloads. As such, react-native-swiper-parallax popularity was classified as not popular.
We found that react-native-swiper-parallax 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.