@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.
- package/lib/commonjs/BaseNavigationContainer.js +6 -1
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
- package/lib/commonjs/StaticNavigation.js +6 -2
- package/lib/commonjs/StaticNavigation.js.map +1 -1
- package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/commonjs/index.js +27 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theming/ThemeContext.js +12 -0
- package/lib/commonjs/theming/ThemeContext.js.map +1 -0
- package/lib/commonjs/theming/ThemeProvider.js +20 -0
- package/lib/commonjs/theming/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theming/useTheme.js +18 -0
- package/lib/commonjs/theming/useTheme.js.map +1 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +79 -16
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +10 -3
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/commonjs/useNavigationCache.js +55 -14
- package/lib/commonjs/useNavigationCache.js.map +1 -1
- package/lib/commonjs/useOnAction.js +3 -1
- package/lib/commonjs/useOnAction.js.map +1 -1
- package/lib/commonjs/usePreventRemove.js +2 -2
- package/lib/commonjs/usePreventRemove.js.map +1 -1
- package/lib/module/BaseNavigationContainer.js +6 -1
- package/lib/module/BaseNavigationContainer.js.map +1 -1
- package/lib/module/StaticNavigation.js +6 -2
- package/lib/module/StaticNavigation.js.map +1 -1
- package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/theming/ThemeContext.js +4 -0
- package/lib/module/theming/ThemeContext.js.map +1 -0
- package/lib/module/theming/ThemeProvider.js +12 -0
- package/lib/module/theming/ThemeProvider.js.map +1 -0
- package/lib/module/theming/useTheme.js +10 -0
- package/lib/module/theming/useTheme.js.map +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/useDescriptors.js +79 -16
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +10 -3
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useNavigationCache.js +55 -14
- package/lib/module/useNavigationCache.js.map +1 -1
- package/lib/module/useOnAction.js +3 -1
- package/lib/module/useOnAction.js.map +1 -1
- package/lib/module/usePreventRemove.js +1 -1
- package/lib/module/usePreventRemove.js.map +1 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -0
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/NavigationStateContext.d.ts +2 -18
- package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -1
- package/lib/typescript/src/StaticNavigation.d.ts.map +1 -1
- package/lib/typescript/src/findFocusedRoute.d.ts +1 -9
- package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +4 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/theming/ThemeContext.d.ts +3 -0
- package/lib/typescript/src/theming/ThemeContext.d.ts.map +1 -0
- package/lib/typescript/src/theming/ThemeProvider.d.ts +8 -0
- package/lib/typescript/src/theming/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/src/theming/useTheme.d.ts +2 -0
- package/lib/typescript/src/theming/useTheme.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +47 -1
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useDescriptors.d.ts +106 -54
- package/lib/typescript/src/useDescriptors.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts +78 -64
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationCache.d.ts +52 -2
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts +8 -55
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -1
- package/lib/typescript/src/useOnAction.d.ts.map +1 -1
- package/lib/typescript/src/usePreventRemove.d.ts +1 -1
- package/lib/typescript/src/usePreventRemove.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/BaseNavigationContainer.tsx +6 -1
- package/src/StaticNavigation.tsx +13 -6
- package/src/getFocusedRouteNameFromRoute.tsx +3 -3
- package/src/index.tsx +4 -1
- package/src/theming/ThemeContext.tsx +7 -0
- package/src/theming/ThemeProvider.tsx +14 -0
- package/src/theming/useTheme.tsx +15 -0
- package/src/types.tsx +66 -1
- package/src/useDescriptors.tsx +148 -34
- package/src/useNavigationBuilder.tsx +21 -7
- package/src/useNavigationCache.tsx +84 -23
- package/src/useOnAction.tsx +6 -1
- package/src/usePreventRemove.tsx +1 -1
package/src/useOnAction.tsx
CHANGED
|
@@ -131,7 +131,12 @@ export function useOnAction({
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
if (
|
|
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--) {
|
package/src/usePreventRemove.tsx
CHANGED
|
@@ -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
|
|
17
|
+
export function usePreventRemove(
|
|
18
18
|
preventRemove: boolean,
|
|
19
19
|
callback: (options: { data: { action: NavigationAction } }) => void
|
|
20
20
|
) {
|