@idealyst/navigation 1.0.79 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -7
- package/src/hooks/index.native.ts +2 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/index.web.ts +2 -0
- package/src/hooks/useParams.native.ts +10 -0
- package/src/hooks/useParams.web.ts +10 -0
- package/src/index.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/navigation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.80",
|
|
4
4
|
"description": "Cross-platform navigation library for React and React Native",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -18,10 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"import": "./src/index.web.ts",
|
|
24
|
-
"require": "./src/index.web.ts",
|
|
21
|
+
"import": "./src/index.ts",
|
|
22
|
+
"require": "./src/index.ts",
|
|
25
23
|
"types": "./src/index.ts"
|
|
26
24
|
},
|
|
27
25
|
"./examples": {
|
|
@@ -40,8 +38,8 @@
|
|
|
40
38
|
"publish:npm": "npm publish"
|
|
41
39
|
},
|
|
42
40
|
"peerDependencies": {
|
|
43
|
-
"@idealyst/components": "^1.0.
|
|
44
|
-
"@idealyst/theme": "^1.0.
|
|
41
|
+
"@idealyst/components": "^1.0.80",
|
|
42
|
+
"@idealyst/theme": "^1.0.80",
|
|
45
43
|
"@react-navigation/bottom-tabs": "^7.0.0",
|
|
46
44
|
"@react-navigation/drawer": "^7.0.0",
|
|
47
45
|
"@react-navigation/native": "^7.0.0",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useRoute } from '@react-navigation/native';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom useParams hook for React Native that wraps React Navigation's useRoute
|
|
5
|
+
* Returns the current route parameters
|
|
6
|
+
*/
|
|
7
|
+
export const useParams = (): Record<string, string> => {
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
return (route.params as Record<string, string>) || {};
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useParams as useReactRouterParams } from 'react-router';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Custom useParams hook that wraps React Router's useParams
|
|
5
|
+
* This ensures we're accessing the correct React Router context
|
|
6
|
+
*/
|
|
7
|
+
export const useParams = (): Record<string, string> => {
|
|
8
|
+
const params = useReactRouterParams();
|
|
9
|
+
return params || {};
|
|
10
|
+
};
|
package/src/index.ts
CHANGED