@react-navigation/core 7.0.0-alpha.6 → 7.0.0-alpha.8

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.
Files changed (90) hide show
  1. package/lib/commonjs/BaseNavigationContainer.js +6 -1
  2. package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
  3. package/lib/commonjs/StaticNavigation.js +6 -2
  4. package/lib/commonjs/StaticNavigation.js.map +1 -1
  5. package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
  6. package/lib/commonjs/index.js +27 -3
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/theming/ThemeContext.js +12 -0
  9. package/lib/commonjs/theming/ThemeContext.js.map +1 -0
  10. package/lib/commonjs/theming/ThemeProvider.js +20 -0
  11. package/lib/commonjs/theming/ThemeProvider.js.map +1 -0
  12. package/lib/commonjs/theming/useTheme.js +18 -0
  13. package/lib/commonjs/theming/useTheme.js.map +1 -0
  14. package/lib/commonjs/types.js.map +1 -1
  15. package/lib/commonjs/useDescriptors.js +79 -16
  16. package/lib/commonjs/useDescriptors.js.map +1 -1
  17. package/lib/commonjs/useNavigationBuilder.js +10 -3
  18. package/lib/commonjs/useNavigationBuilder.js.map +1 -1
  19. package/lib/commonjs/useNavigationCache.js +55 -14
  20. package/lib/commonjs/useNavigationCache.js.map +1 -1
  21. package/lib/commonjs/useOnAction.js +3 -1
  22. package/lib/commonjs/useOnAction.js.map +1 -1
  23. package/lib/commonjs/usePreventRemove.js +2 -2
  24. package/lib/commonjs/usePreventRemove.js.map +1 -1
  25. package/lib/module/BaseNavigationContainer.js +6 -1
  26. package/lib/module/BaseNavigationContainer.js.map +1 -1
  27. package/lib/module/StaticNavigation.js +6 -2
  28. package/lib/module/StaticNavigation.js.map +1 -1
  29. package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
  30. package/lib/module/index.js +4 -1
  31. package/lib/module/index.js.map +1 -1
  32. package/lib/module/theming/ThemeContext.js +4 -0
  33. package/lib/module/theming/ThemeContext.js.map +1 -0
  34. package/lib/module/theming/ThemeProvider.js +12 -0
  35. package/lib/module/theming/ThemeProvider.js.map +1 -0
  36. package/lib/module/theming/useTheme.js +10 -0
  37. package/lib/module/theming/useTheme.js.map +1 -0
  38. package/lib/module/types.js.map +1 -1
  39. package/lib/module/useDescriptors.js +79 -16
  40. package/lib/module/useDescriptors.js.map +1 -1
  41. package/lib/module/useNavigationBuilder.js +10 -3
  42. package/lib/module/useNavigationBuilder.js.map +1 -1
  43. package/lib/module/useNavigationCache.js +55 -14
  44. package/lib/module/useNavigationCache.js.map +1 -1
  45. package/lib/module/useOnAction.js +3 -1
  46. package/lib/module/useOnAction.js.map +1 -1
  47. package/lib/module/usePreventRemove.js +1 -1
  48. package/lib/module/usePreventRemove.js.map +1 -1
  49. package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -0
  50. package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -1
  51. package/lib/typescript/src/NavigationStateContext.d.ts +2 -18
  52. package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -1
  53. package/lib/typescript/src/StaticNavigation.d.ts.map +1 -1
  54. package/lib/typescript/src/findFocusedRoute.d.ts +1 -9
  55. package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -1
  56. package/lib/typescript/src/index.d.ts +4 -1
  57. package/lib/typescript/src/index.d.ts.map +1 -1
  58. package/lib/typescript/src/theming/ThemeContext.d.ts +3 -0
  59. package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -0
  60. package/lib/typescript/src/theming/ThemeProvider.d.ts +8 -0
  61. package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -0
  62. package/lib/typescript/src/theming/useTheme.d.ts +2 -0
  63. package/lib/typescript/src/theming/useTheme.d.ts.map +1 -0
  64. package/lib/typescript/src/types.d.ts +47 -1
  65. package/lib/typescript/src/types.d.ts.map +1 -1
  66. package/lib/typescript/src/useDescriptors.d.ts +106 -54
  67. package/lib/typescript/src/useDescriptors.d.ts.map +1 -1
  68. package/lib/typescript/src/useNavigationBuilder.d.ts +78 -64
  69. package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -1
  70. package/lib/typescript/src/useNavigationCache.d.ts +52 -2
  71. package/lib/typescript/src/useNavigationCache.d.ts.map +1 -1
  72. package/lib/typescript/src/useNavigationHelpers.d.ts +8 -55
  73. package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -1
  74. package/lib/typescript/src/useOnAction.d.ts.map +1 -1
  75. package/lib/typescript/src/usePreventRemove.d.ts +1 -1
  76. package/lib/typescript/src/usePreventRemove.d.ts.map +1 -1
  77. package/package.json +8 -8
  78. package/src/BaseNavigationContainer.tsx +6 -1
  79. package/src/StaticNavigation.tsx +13 -6
  80. package/src/getFocusedRouteNameFromRoute.tsx +3 -3
  81. package/src/index.tsx +4 -1
  82. package/src/theming/ThemeContext.tsx +7 -0
  83. package/src/theming/ThemeProvider.tsx +14 -0
  84. package/src/theming/useTheme.tsx +15 -0
  85. package/src/types.tsx +66 -1
  86. package/src/useDescriptors.tsx +148 -34
  87. package/src/useNavigationBuilder.tsx +21 -7
  88. package/src/useNavigationCache.tsx +84 -23
  89. package/src/useOnAction.tsx +6 -1
  90. package/src/usePreventRemove.tsx +1 -1
@@ -131,7 +131,12 @@ export function useOnAction({
131
131
  }
132
132
  }
133
133
 
134
- if (typeof action.target === 'string' || navigationInChildEnabled) {
134
+ if (
135
+ typeof action.target === 'string' ||
136
+ // For backward compatibility
137
+ action.type === 'NAVIGATE_DEPRECATED' ||
138
+ navigationInChildEnabled
139
+ ) {
135
140
  // If the action wasn't handled by current navigator or a parent navigator, let children handle it
136
141
  // Handling this when target isn't specified is deprecated and will be removed in the future
137
142
  for (let i = actionListeners.length - 1; i >= 0; i--) {
@@ -14,7 +14,7 @@ import { useRoute } from './useRoute';
14
14
  * @param preventRemove Boolean indicating whether to prevent screen from being removed.
15
15
  * @param callback Function which is executed when screen was prevented from being removed.
16
16
  */
17
- export function UNSTABLE_usePreventRemove(
17
+ export function usePreventRemove(
18
18
  preventRemove: boolean,
19
19
  callback: (options: { data: { action: NavigationAction } }) => void
20
20
  ) {