@umituz/react-native-design-system 4.25.19 → 4.25.21

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": "@umituz/react-native-design-system",
3
- "version": "4.25.19",
3
+ "version": "4.25.21",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,4 +1,4 @@
1
- import { useNavigation, CommonActions } from "@react-navigation/native";
1
+ import { useNavigation, StackActions } from "@react-navigation/native";
2
2
  import type { NavigationProp, ParamListBase } from "@react-navigation/native";
3
3
  import { useCallback, useMemo } from "react";
4
4
 
@@ -22,6 +22,7 @@ export interface AppNavigationResult {
22
22
  * useAppNavigation Hook
23
23
  *
24
24
  * Clean navigation API without complex type casting.
25
+ * Uses navigation.navigate() directly for proper nested navigator support.
25
26
  * Use: const navigation = useAppNavigation();
26
27
  * navigation.navigate("ScreenName", { param: value });
27
28
  */
@@ -30,22 +31,20 @@ export function useAppNavigation(): AppNavigationResult {
30
31
 
31
32
  const navigate = useCallback(
32
33
  (screen: string, params?: Record<string, unknown>) => {
33
- navigation.dispatch(CommonActions.navigate({ name: screen, params }));
34
+ (navigation as any).navigate(screen, params);
34
35
  },
35
36
  [navigation]
36
37
  );
37
38
 
38
39
  const push = useCallback(
39
40
  (screen: string, params?: Record<string, unknown>) => {
40
- navigation.dispatch({ type: "PUSH", payload: { name: screen, params } });
41
+ navigation.dispatch(StackActions.push(screen, params));
41
42
  },
42
43
  [navigation]
43
44
  );
44
45
 
45
46
  const goBack = useCallback(() => {
46
- if (navigation.canGoBack()) {
47
- navigation.goBack();
48
- }
47
+ navigation.goBack();
49
48
  }, [navigation]);
50
49
 
51
50
  const reset = useCallback(
@@ -57,20 +56,20 @@ export function useAppNavigation(): AppNavigationResult {
57
56
 
58
57
  const replace = useCallback(
59
58
  (screen: string, params?: Record<string, unknown>) => {
60
- navigation.dispatch({ type: "REPLACE", payload: { name: screen, params } });
59
+ navigation.dispatch(StackActions.replace(screen, params));
61
60
  },
62
61
  [navigation]
63
62
  );
64
63
 
65
64
  const pop = useCallback(
66
65
  (count = 1) => {
67
- navigation.dispatch({ type: "POP", payload: { count } });
66
+ navigation.dispatch(StackActions.pop(count));
68
67
  },
69
68
  [navigation]
70
69
  );
71
70
 
72
71
  const popToTop = useCallback(() => {
73
- navigation.dispatch({ type: "POP_TO_TOP" });
72
+ navigation.dispatch(StackActions.popToTop());
74
73
  }, [navigation]);
75
74
 
76
75
  const canGoBack = useCallback(() => navigation.canGoBack(), [navigation]);