Socket
Socket
Sign inDemoInstall

rn-push

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rn-push - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

28

index.js
import React from "react";
import { View, Animated, ScrollView, Dimensions, BackHandler } from "react-native";
import {
View,
Animated,
ScrollView,
Dimensions,
BackHandler
} from "react-native";

@@ -13,13 +19,9 @@ const window = Dimensions.get("window");

componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', () => {
BackHandler.addEventListener("hardwareBackPress", () => {
if (this.state.show && this.scrollView) {
this.scrollView._component.scrollTo({ x: 0 })
this.scrollView._component.scrollTo({ x: 0 });
return true;
}
return false;
})
});
}

@@ -116,6 +118,8 @@

>
{React.createElement(this.component, {
...this.propsToPass,
pop: () => this.scrollView._component.scrollTo({ x: 0 })
})}
<Push>
{React.createElement(this.component, {
...this.propsToPass,
pop: () => this.scrollView._component.scrollTo({ x: 0 })
})}
</Push>
</View>

@@ -122,0 +126,0 @@ </Animated.ScrollView>

{
"name": "rn-push",
"version": "2.0.0",
"version": "2.0.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "private": false,

@@ -5,3 +5,3 @@ # React Native simplest push from right transition

<img src="https://thumbs.gfycat.com/DependentForsakenAustraliancurlew-size_restricted.gif" />
<img src="https://thumbs.gfycat.com/DependentForsakenAustraliancurlew-size_restricted.gif" />

@@ -32,3 +32,3 @@ ## Why would You use this library?

This component takes a single children and passes a `push` prop to it. Component that You will push to will receive `pop` prop.
This component takes a single children and passes a `push` prop to it. Component that You will push to will receive `pop` prop. You can push deeper from the screen that is already pushed.

@@ -35,0 +35,0 @@ ```js

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc