Gathering detailed insights and metrics for rn-stack-router
Gathering detailed insights and metrics for rn-stack-router
Gathering detailed insights and metrics for rn-stack-router
Gathering detailed insights and metrics for rn-stack-router
A Router Navigation Component based on Stack Navigation extremely simple implement
npm install rn-stack-router
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
1 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Oct 21, 2016
Latest Version
1.0.0
Package Id
rn-stack-router@1.0.0
Size
5.65 kB
NPM Version
3.10.3
Node Version
6.5.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
This is a simpler way to use Navigator with URI driven navigation facilitating simple transfer of data between Screens.
This component provides Navigation and 2 useful utilities to provide Stack Like navigation.
Install:
npm install --save rn-stack-router
Add it you your application:
First let create a Screen
1 2import React from 'react'; 3 4import { 5 Text, 6 Navigator 7 Platform 8} from 'react-native'; 9 10import { NavigationHelper, Screen } from 'rn-stack-router'; 11 12export default class MyFirstScreen extends Screen { 13 constructor(props) { 14 super(props); 15 } 16 17 static screenName() { 18 return 'myscreen'; 19 } 20 21 static routeName() { 22 return '/myscreen'; 23 } 24 25 static getDefaultProps() { 26 return { 27 defaultAnimation: Navigator.SceneConfigs.FadeAndroid, 28 useCache: false, 29 props: { 30 id: 'something' 31 } 32 }; 33 } 34 35 render() { 36 return ( 37 <Text>Hello World</Text> 38 ); 39 } 40}
1 2import React from 'react'; 3import {AppRegistry} from 'react-native'; 4 5import { 6 Router, 7 RouteNavigator, 8 NavigationHelper 9} from 'rn-stack-router'; 10 11import MyFirstScreen from './MyFirstScreen'; 12 13class MyApp extends React.Component { 14 render() { 15 return <RouteNavigator initialRouteStack={[{name: '/myscreen'}]} 16 router={this.router} 17 app={this} />; 18 } 19 20 get router() { 21 var _router = NavigationHelper.getRouter(); 22 23 // Add Routes if empty 24 if (!NavigationHelper.hasRoutes()) { 25 this.addRoutes(); 26 } 27 28 // Return the router 29 return _router; 30 } 31 32 addRoutes() { 33 var options = {}; 34 35 // Add our routes here 36 NavigationHelper.addRoute(MyFirstScreen); 37 } 38} 39 40AppRegistry.registerComponent('MyApp', () => MyApp);
This extends reacts Navigator class.
app
- Application reference to pass to all managed components.Router
- The composed router to use for route navigation.When you define an screen there are some important steps to folow:
1export default class MyScreen extends Screen { 2 3}
1static screenName() { 2 return 'myscreen'; 3}
1static routeName() { 2 return '/myscreen'; 3}
Optional
You can define some options on the View using the getDefaultProps static method
1static getDefaultProps() { 2 return { 3 defaultAnimation: Navigator.SceneConfigs.FadeAndroid, 4 useCache: false, 5 props: { 6 id: 'something' 7 } 8 }; 9 }
You can navigate using NavigationHelper
Methods:
Nav Object Components:
name
- The name or URI of the routeanimation
- The animation to use for the transitionprops
- Additional props to use for the controllerbody
- The body object to pass to the controller.Examples:
1// Go back to previous controller in route stack 2NavigationHelper.pop(); 3 4// Navigate By URI 5NavigationHelper.push('/myscreen/123'); 6 7// URI with Non Default Animation 8NavigationHelper.push({ 9 name: '/myscreen/123', 10 animation: Navigator.SceneConfigs.FadeAndroid, 11 props: { 12 isRed: true 13 }, 14 body: { 15 id: 'my_id' 16 } 17}); 18 19// Navigate By Name 20NavigationHelper.push('page1'); 21NavigationHelper.push({ name: 'page1'});
Important To receive body and query you must query them from componentDidMount
You can receive URI parameters via this.state.query
and the body object via this.state.body
.
This Navigation component is heavily inspired on react-native-route-navigator.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More