Socket
Socket
Sign inDemoInstall

rn-push

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

1

index.js

@@ -64,2 +64,3 @@ import React from "react";

{React.cloneElement(this.props.children, {
pushState: this.state.show,
push: params => {

@@ -66,0 +67,0 @@ this.propsToPass = params.passProps;

2

package.json
{
"name": "rn-push",
"version": "2.0.1",
"version": "2.0.2",
"main": "index.js",

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

@@ -71,1 +71,32 @@ # React Native simplest push from right transition

```
Component that you push from receieves `pushState` prop. You can do something like this:
```js
class Screen extends Component {
componentWillReceiveProps(props) {
if (props.pushState === false) {
// do something when user goes back
// ie. fetch data to update Your view or something like that
}
}
render() {
return (
<View>
<Button
title="Next"
onPress={() =>
props.push({
component: Screen2,
passProps: {
title: "Previous"
}
})
}
/>
</View>
);
}
}
```
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc