@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idealyst/navigation",
3
- "version": "1.0.79",
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
- "react-native": "./src/index.native.ts",
22
- "default": "./src/index.web.ts",
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.79",
44
- "@idealyst/theme": "^1.0.79",
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,2 @@
1
+ // Native-specific hook exports
2
+ export * from './useParams.native';
@@ -0,0 +1,2 @@
1
+ // Cross-platform hook exports
2
+ export * from './useParams.web'; // This will be overridden by platform-specific exports
@@ -0,0 +1,2 @@
1
+ // Web-specific hook exports
2
+ export * from './useParams.web';
@@ -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
@@ -1,4 +1,5 @@
1
1
  // Cross-platform exports
2
2
  export * from './context';
3
3
  export * from './layouts';
4
- export * from './routing';
4
+ export * from './routing';
5
+ export * from './hooks';