Gathering detailed insights and metrics for react-navigation-helpers
Gathering detailed insights and metrics for react-navigation-helpers
Gathering detailed insights and metrics for react-navigation-helpers
Gathering detailed insights and metrics for react-navigation-helpers
react-navigation-redux-helpers
Redux middleware and utils for React Navigation
react-native-navigation-redux-helpers
Redux helpers for React Native navigation
react-navigation-mobx-helpers
React-Navigation bindings for MobX
react-navigation-browser-history-helpers
Helpers to make react-navigation have browser history.
npm install react-navigation-helpers
Typescript
Module System
Node Version
NPM Version
46.2
Supply Chain
63.5
Quality
66.5
Maintenance
50
Vulnerability
93.8
License
navigate helper type fix
Updated on Jul 10, 2023
feat: replace and jumpTo helpers 🍻
Updated on Jul 10, 2023
feat: Global Stack Navigator Events 😍
Updated on Aug 26, 2022
Better library itself 🥳
Updated on May 07, 2022
Version 2 is here 😍
Updated on Sep 17, 2021
Better Typescript Implementation 🥳
Updated on Apr 18, 2021
Java (31.46%)
JavaScript (24.91%)
TypeScript (20.45%)
Objective-C (15.47%)
Ruby (5.14%)
Starlark (2.07%)
Shell (0.51%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
131,205
Last Day
611
Last Week
2,458
Last Month
7,157
Last Year
55,141
MIT License
60 Stars
1,651 Commits
6 Forks
3 Watchers
4 Branches
3 Contributors
Updated on Feb 13, 2025
Minified
Minified + Gzipped
Latest Version
2.3.1
Package Id
react-navigation-helpers@2.3.1
Unpacked Size
1.78 MB
Size
527.55 kB
File Count
100
NPM Version
9.5.1
Node Version
18.16.0
Published on
Jul 10, 2023
Cumulative downloads
Total Downloads
Last Day
-19%
611
Compared to previous day
Last Week
-1.4%
2,458
Compared to previous week
Last Month
143.2%
7,157
Compared to previous month
Last Year
30.7%
55,141
Compared to previous year
Add the dependency:
1npm i react-navigation-helpers
Works with React Navigation
1"@react-navigation/native": ">= 4.x.x"
Version | Supported React Navigation Version |
---|---|
2.0.0 > | v6 |
1.1.1 | v5 |
< 0.1.0 | v4 |
Set the global level navigation reference into the NavigationContainer
1import { isReadyRef, navigationRef } from "react-navigation-helpers"; 2 3useEffect((): any => { 4 return () => (isReadyRef.current = false); 5}, []); 6 7<NavigationContainer 8 ref={navigationRef} 9 onReady={() => { 10 isReadyRef.current = true; 11 }} 12> 13 {/* Rest of your code */} 14</NavigationContainer>;
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.navigate("home");
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.push("home");
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.pop();
1import * as NavigationService from "react-navigation-helpers";
2
3NavigationService.popToTop();
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.back();
The usage does not change. Simply put your prop as the secondary prop as same as React Navigation itself.
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.navigate("home", { data: myData, myId: "d1f01df1" });
1import * as NavigationService from "react-navigation-helpers"; 2 3NavigationService.push("home", { data: myData, myId: "d1f01df1" });
1const { data, id } = this.props.route.params;
Property | Type | Default | Description |
---|---|---|---|
navigate | function | function | navigate the selected screen |
push | function | function | push the selected screen |
goBack | function | function | back the previous screen |
pop | function | function | pop the previous screen |
popToTop | function | function | pop the top level of the screen |
reset | function | function | reset the navigator |
To listen to the Stack navigator events from anywhere, you need to import navigationListenerProps
and spread it as props. It is currently limited to a single stack navigator.
1import { isReadyRef, navigationRef, navigationListenerProps } from "react-navigation-helpers"; 2 3useEffect((): any => { 4 return () => (isReadyRef.current = false); 5}, []); 6 7<NavigationContainer 8 ref={navigationRef} 9 onReady={() => { 10 isReadyRef.current = true; 11 }} 12> 13 <Stack.Navigator {...navigationListenerProps}> 14 {/* Rest of your code */} 15 </Stack.Navigator> 16</NavigationContainer>;
you can then listen to stack navigation events anywhere in your app.
Example in a component:
1import React, {useEffect} from "react" 2import {addNavigationListener} from "react-navigation-helpers" 3// or as a whole 4import * as NavigationService from "react-navigation-helpers"; 5 6const MyComponent = () => { 7 8 useEffect(() => { 9 return addNavigationListener("transitionEnd", () => { 10 // transition ended 11 }) 12 }) 13 14 // or like this 15 useEffect(() => { 16 return NavigationService.addNavigationListener("transitionEnd", () => { 17 // transition ended 18 }) 19 }) 20 21 return ( 22 <Text>Hello world!</Text> 23 ) 24}
FreakyCoder, kurayogun@gmail.com
React Navigation Helpers Library is available under the MIT license. See the LICENSE file for more info.
No vulnerabilities found.
No security vulnerabilities found.