Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
rn-push
Advanced tools
Readme
No need to link any native code.
There are three approaches to handle navigation in React Native app:
This library represents third approach. But it is better than others becuase it uses scrollview as a gesture handler under the hood, which means You don't have to run animations on JS thread.
yarn add rn-push
npm install rn-push
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.
import Push from "rn-push";
function App(props) {
// you can pass color prop (default: #efefef)
return (
<Push color="#efefef">
<Screen />
</Push>
);
}
function Screen(props) {
return (
<View>
<Button
title="Next"
onPress={() =>
props.push({
component: Screen2,
passProps: {
title: "Previous"
}
})
}
/>
</View>
);
}
function Screen2(props) {
return (
<View>
<Button title={props.title} onPress={() => props.pop()} />
</View>
);
}
Component that you push from receieves pushState
prop. You can do something like this:
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>
);
}
}
FAQs
No need to link any native code.
The npm package rn-push receives a total of 1 weekly downloads. As such, rn-push popularity was classified as not popular.
We found that rn-push 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.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.