@react-navigation/core 6.4.5 → 7.0.0-alpha.0
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/README.md +1 -1
- package/lib/commonjs/BaseNavigationContainer.js +44 -33
- package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
- package/lib/commonjs/DeprecatedNavigationInChildContext.js +16 -0
- package/lib/commonjs/DeprecatedNavigationInChildContext.js.map +1 -0
- package/lib/commonjs/NavigationIndependentTree.js +33 -0
- package/lib/commonjs/NavigationIndependentTree.js.map +1 -0
- package/lib/commonjs/NavigationIndependentTreeContext.js +16 -0
- package/lib/commonjs/NavigationIndependentTreeContext.js.map +1 -0
- package/lib/commonjs/StaticNavigation.js +160 -0
- package/lib/commonjs/StaticNavigation.js.map +1 -0
- package/lib/commonjs/createNavigatorFactory.js +16 -7
- package/lib/commonjs/createNavigatorFactory.js.map +1 -1
- package/lib/commonjs/getActionFromState.js.map +1 -1
- package/lib/commonjs/index.js +52 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useDescriptors.js +21 -18
- package/lib/commonjs/useDescriptors.js.map +1 -1
- package/lib/commonjs/useNavigationBuilder.js +1 -1
- package/lib/commonjs/useNavigationBuilder.js.map +1 -1
- package/lib/commonjs/useNavigationCache.js +9 -7
- package/lib/commonjs/useNavigationCache.js.map +1 -1
- package/lib/commonjs/useNavigationIndependentTree.js +15 -0
- package/lib/commonjs/useNavigationIndependentTree.js.map +1 -0
- package/lib/commonjs/useOnAction.js +11 -7
- package/lib/commonjs/useOnAction.js.map +1 -1
- package/lib/module/BaseNavigationContainer.js +44 -33
- package/lib/module/BaseNavigationContainer.js.map +1 -1
- package/lib/module/DeprecatedNavigationInChildContext.js +8 -0
- package/lib/module/DeprecatedNavigationInChildContext.js.map +1 -0
- package/lib/module/NavigationIndependentTree.js +25 -0
- package/lib/module/NavigationIndependentTree.js.map +1 -0
- package/lib/module/NavigationIndependentTreeContext.js +8 -0
- package/lib/module/NavigationIndependentTreeContext.js.map +1 -0
- package/lib/module/StaticNavigation.js +156 -0
- package/lib/module/StaticNavigation.js.map +1 -0
- package/lib/module/createNavigatorFactory.js +16 -7
- package/lib/module/createNavigatorFactory.js.map +1 -1
- package/lib/module/getActionFromState.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/useDescriptors.js +21 -18
- package/lib/module/useDescriptors.js.map +1 -1
- package/lib/module/useNavigationBuilder.js +1 -1
- package/lib/module/useNavigationBuilder.js.map +1 -1
- package/lib/module/useNavigationCache.js +9 -7
- package/lib/module/useNavigationCache.js.map +1 -1
- package/lib/module/useNavigationIndependentTree.js +6 -0
- package/lib/module/useNavigationIndependentTree.js.map +1 -0
- package/lib/module/useOnAction.js +11 -7
- package/lib/module/useOnAction.js.map +1 -1
- package/lib/typescript/src/BaseNavigationContainer.d.ts +2 -0
- package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -1
- package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts +7 -0
- package/lib/typescript/src/DeprecatedNavigationInChildContext.d.ts.map +1 -0
- package/lib/typescript/src/EnsureSingleNavigator.d.ts +1 -1
- package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -1
- package/lib/typescript/src/NavigationBuilderContext.d.ts +9 -9
- package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -1
- package/lib/typescript/src/NavigationIndependentTree.d.ts +8 -0
- package/lib/typescript/src/NavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/src/NavigationIndependentTreeContext.d.ts +7 -0
- package/lib/typescript/src/NavigationIndependentTreeContext.d.ts.map +1 -0
- package/lib/typescript/src/PreventRemoveContext.d.ts +1 -1
- package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -1
- package/lib/typescript/src/PreventRemoveProvider.d.ts +1 -1
- package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -1
- package/lib/typescript/src/SceneView.d.ts +1 -1
- package/lib/typescript/src/SceneView.d.ts.map +1 -1
- package/lib/typescript/src/StaticNavigation.d.ts +159 -0
- package/lib/typescript/src/StaticNavigation.d.ts.map +1 -0
- package/lib/typescript/src/createNavigatorFactory.d.ts +8 -2
- package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -1
- package/lib/typescript/src/getActionFromState.d.ts +2 -2
- package/lib/typescript/src/getActionFromState.d.ts.map +1 -1
- package/lib/typescript/src/getPathFromState.d.ts +2 -2
- package/lib/typescript/src/getPathFromState.d.ts.map +1 -1
- package/lib/typescript/src/getStateFromPath.d.ts +2 -2
- package/lib/typescript/src/getStateFromPath.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +109 -57
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useComponent.d.ts +1 -1
- package/lib/typescript/src/useComponent.d.ts.map +1 -1
- package/lib/typescript/src/useCurrentRender.d.ts +1 -1
- package/lib/typescript/src/useCurrentRender.d.ts.map +1 -1
- package/lib/typescript/src/useDescriptors.d.ts +11 -9
- package/lib/typescript/src/useDescriptors.d.ts.map +1 -1
- package/lib/typescript/src/useEventEmitter.d.ts +1 -1
- package/lib/typescript/src/useEventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/useFocusEffect.d.ts +1 -1
- package/lib/typescript/src/useFocusEffect.d.ts.map +1 -1
- package/lib/typescript/src/useFocusEvents.d.ts +1 -1
- package/lib/typescript/src/useFocusEvents.d.ts.map +1 -1
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts +1 -1
- package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationBuilder.d.ts +33 -17
- package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationCache.d.ts +4 -4
- package/lib/typescript/src/useNavigationCache.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationHelpers.d.ts +11 -9
- package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -1
- package/lib/typescript/src/useNavigationIndependentTree.d.ts +2 -0
- package/lib/typescript/src/useNavigationIndependentTree.d.ts.map +1 -0
- package/lib/typescript/src/useNavigationState.d.ts +1 -1
- package/lib/typescript/src/useNavigationState.d.ts.map +1 -1
- package/lib/typescript/src/useOnAction.d.ts +1 -1
- package/lib/typescript/src/useOnAction.d.ts.map +1 -1
- package/lib/typescript/src/useOnGetState.d.ts +1 -1
- package/lib/typescript/src/useOnGetState.d.ts.map +1 -1
- package/lib/typescript/src/useOnPreventRemove.d.ts +1 -1
- package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -1
- package/lib/typescript/src/useOnRouteFocus.d.ts +1 -1
- package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -1
- package/lib/typescript/src/useOptionsGetters.d.ts +1 -1
- package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/BaseNavigationContainer.tsx +68 -64
- package/src/DeprecatedNavigationInChildContext.tsx +8 -0
- package/src/NavigationIndependentTree.tsx +25 -0
- package/src/NavigationIndependentTreeContext.tsx +8 -0
- package/src/StaticNavigation.tsx +401 -0
- package/src/createNavigatorFactory.tsx +38 -9
- package/src/getActionFromState.tsx +2 -8
- package/src/getPathFromState.tsx +1 -1
- package/src/index.tsx +9 -0
- package/src/types.tsx +111 -40
- package/src/useDescriptors.tsx +24 -19
- package/src/useNavigationBuilder.tsx +26 -5
- package/src/useNavigationCache.tsx +8 -4
- package/src/useNavigationIndependentTree.tsx +7 -0
- package/src/useOnAction.tsx +13 -5
|
@@ -8,16 +8,17 @@ import {
|
|
|
8
8
|
Route,
|
|
9
9
|
} from '@react-navigation/routers';
|
|
10
10
|
import * as React from 'react';
|
|
11
|
+
import useLatestCallback from 'use-latest-callback';
|
|
11
12
|
|
|
12
13
|
import checkDuplicateRouteNames from './checkDuplicateRouteNames';
|
|
13
14
|
import checkSerializable from './checkSerializable';
|
|
14
15
|
import { NOT_INITIALIZED_ERROR } from './createNavigationContainerRef';
|
|
16
|
+
import DeprecatedNavigationInChildContext from './DeprecatedNavigationInChildContext';
|
|
15
17
|
import EnsureSingleNavigator from './EnsureSingleNavigator';
|
|
16
18
|
import findFocusedRoute from './findFocusedRoute';
|
|
17
19
|
import NavigationBuilderContext from './NavigationBuilderContext';
|
|
18
20
|
import NavigationContainerRefContext from './NavigationContainerRefContext';
|
|
19
|
-
import
|
|
20
|
-
import NavigationRouteContext from './NavigationRouteContext';
|
|
21
|
+
import NavigationIndependentTreeContext from './NavigationIndependentTreeContext';
|
|
21
22
|
import NavigationStateContext from './NavigationStateContext';
|
|
22
23
|
import type {
|
|
23
24
|
NavigationContainerEventMap,
|
|
@@ -28,6 +29,7 @@ import UnhandledActionContext from './UnhandledActionContext';
|
|
|
28
29
|
import useChildListeners from './useChildListeners';
|
|
29
30
|
import useEventEmitter from './useEventEmitter';
|
|
30
31
|
import useKeyedChildListeners from './useKeyedChildListeners';
|
|
32
|
+
import useNavigationIndependentTree from './useNavigationIndependentTree';
|
|
31
33
|
import useOptionsGetters from './useOptionsGetters';
|
|
32
34
|
import { ScheduleUpdateContext } from './useScheduleUpdate';
|
|
33
35
|
import useSyncState from './useSyncState';
|
|
@@ -72,7 +74,9 @@ const getPartialState = (
|
|
|
72
74
|
* This should be rendered at the root wrapping the whole app.
|
|
73
75
|
*
|
|
74
76
|
* @param props.initialState Initial state object for the navigation tree.
|
|
77
|
+
* @param props.onReady Callback which is called after the navigation tree mounts.
|
|
75
78
|
* @param props.onStateChange Callback which is called with the latest navigation state when it changes.
|
|
79
|
+
* @param props.onUnhandledAction Callback which is called when an action is not handled.
|
|
76
80
|
* @param props.children Child elements to render the content.
|
|
77
81
|
* @param props.ref Ref object which refers to the navigation object containing helper methods.
|
|
78
82
|
*/
|
|
@@ -81,17 +85,19 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
81
85
|
{
|
|
82
86
|
initialState,
|
|
83
87
|
onStateChange,
|
|
88
|
+
onReady,
|
|
84
89
|
onUnhandledAction,
|
|
85
|
-
|
|
90
|
+
navigationInChildEnabled = false,
|
|
86
91
|
children,
|
|
87
92
|
}: NavigationContainerProps,
|
|
88
93
|
ref?: React.Ref<NavigationContainerRef<ParamListBase>>
|
|
89
94
|
) {
|
|
90
95
|
const parent = React.useContext(NavigationStateContext);
|
|
96
|
+
const independent = useNavigationIndependentTree();
|
|
91
97
|
|
|
92
98
|
if (!parent.isDefault && !independent) {
|
|
93
99
|
throw new Error(
|
|
94
|
-
"Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional,
|
|
100
|
+
"Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional, wrap the container in 'NavigationIndependentTree' explicitly. Note that this will make the child navigators disconnected from the parent and you won't be able to navigate between them."
|
|
95
101
|
);
|
|
96
102
|
}
|
|
97
103
|
|
|
@@ -114,7 +120,7 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
114
120
|
|
|
115
121
|
const { keyedListeners, addKeyedListener } = useKeyedChildListeners();
|
|
116
122
|
|
|
117
|
-
const dispatch =
|
|
123
|
+
const dispatch = useLatestCallback(
|
|
118
124
|
(
|
|
119
125
|
action:
|
|
120
126
|
| NavigationAction
|
|
@@ -125,11 +131,10 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
125
131
|
} else {
|
|
126
132
|
listeners.focus[0]((navigation) => navigation.dispatch(action));
|
|
127
133
|
}
|
|
128
|
-
}
|
|
129
|
-
[listeners.focus]
|
|
134
|
+
}
|
|
130
135
|
);
|
|
131
136
|
|
|
132
|
-
const canGoBack =
|
|
137
|
+
const canGoBack = useLatestCallback(() => {
|
|
133
138
|
if (listeners.focus[0] == null) {
|
|
134
139
|
return false;
|
|
135
140
|
}
|
|
@@ -143,9 +148,9 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
143
148
|
} else {
|
|
144
149
|
return false;
|
|
145
150
|
}
|
|
146
|
-
}
|
|
151
|
+
});
|
|
147
152
|
|
|
148
|
-
const resetRoot =
|
|
153
|
+
const resetRoot = useLatestCallback(
|
|
149
154
|
(state?: PartialState<NavigationState> | NavigationState) => {
|
|
150
155
|
const target = state?.key ?? keyedListeners.getState.root?.().key;
|
|
151
156
|
|
|
@@ -159,15 +164,14 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
159
164
|
})
|
|
160
165
|
);
|
|
161
166
|
}
|
|
162
|
-
}
|
|
163
|
-
[keyedListeners.getState, listeners.focus]
|
|
167
|
+
}
|
|
164
168
|
);
|
|
165
169
|
|
|
166
|
-
const getRootState =
|
|
170
|
+
const getRootState = useLatestCallback(() => {
|
|
167
171
|
return keyedListeners.getState.root?.();
|
|
168
|
-
}
|
|
172
|
+
});
|
|
169
173
|
|
|
170
|
-
const getCurrentRoute =
|
|
174
|
+
const getCurrentRoute = useLatestCallback(() => {
|
|
171
175
|
const state = getRootState();
|
|
172
176
|
|
|
173
177
|
if (state == null) {
|
|
@@ -177,7 +181,9 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
177
181
|
const route = findFocusedRoute(state);
|
|
178
182
|
|
|
179
183
|
return route as Route<string> | undefined;
|
|
180
|
-
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const isReady = useLatestCallback(() => listeners.focus[0] != null);
|
|
181
187
|
|
|
182
188
|
const emitter = useEventEmitter<NavigationContainerEventMap>();
|
|
183
189
|
|
|
@@ -201,7 +207,7 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
201
207
|
getRootState,
|
|
202
208
|
getCurrentRoute,
|
|
203
209
|
getCurrentOptions,
|
|
204
|
-
isReady
|
|
210
|
+
isReady,
|
|
205
211
|
}),
|
|
206
212
|
[
|
|
207
213
|
canGoBack,
|
|
@@ -210,40 +216,36 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
210
216
|
getCurrentOptions,
|
|
211
217
|
getCurrentRoute,
|
|
212
218
|
getRootState,
|
|
213
|
-
|
|
219
|
+
isReady,
|
|
214
220
|
resetRoot,
|
|
215
221
|
]
|
|
216
222
|
);
|
|
217
223
|
|
|
218
224
|
React.useImperativeHandle(ref, () => navigation, [navigation]);
|
|
219
225
|
|
|
220
|
-
const onDispatchAction =
|
|
226
|
+
const onDispatchAction = useLatestCallback(
|
|
221
227
|
(action: NavigationAction, noop: boolean) => {
|
|
222
228
|
emitter.emit({
|
|
223
229
|
type: '__unsafe_action__',
|
|
224
230
|
data: { action, noop, stack: stackRef.current },
|
|
225
231
|
});
|
|
226
|
-
}
|
|
227
|
-
[emitter]
|
|
232
|
+
}
|
|
228
233
|
);
|
|
229
234
|
|
|
230
235
|
const lastEmittedOptionsRef = React.useRef<object | undefined>();
|
|
231
236
|
|
|
232
|
-
const onOptionsChange =
|
|
233
|
-
(options
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
+
const onOptionsChange = useLatestCallback((options: object) => {
|
|
238
|
+
if (lastEmittedOptionsRef.current === options) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
237
241
|
|
|
238
|
-
|
|
242
|
+
lastEmittedOptionsRef.current = options;
|
|
239
243
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
[emitter]
|
|
246
|
-
);
|
|
244
|
+
emitter.emit({
|
|
245
|
+
type: 'options',
|
|
246
|
+
data: { options },
|
|
247
|
+
});
|
|
248
|
+
});
|
|
247
249
|
|
|
248
250
|
const stackRef = React.useRef<string | undefined>();
|
|
249
251
|
|
|
@@ -288,15 +290,25 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
288
290
|
]
|
|
289
291
|
);
|
|
290
292
|
|
|
293
|
+
const onReadyRef = React.useRef(onReady);
|
|
291
294
|
const onStateChangeRef = React.useRef(onStateChange);
|
|
292
295
|
const stateRef = React.useRef(state);
|
|
293
296
|
|
|
294
297
|
React.useEffect(() => {
|
|
295
298
|
isInitialRef.current = false;
|
|
296
299
|
onStateChangeRef.current = onStateChange;
|
|
300
|
+
onReadyRef.current = onReady;
|
|
297
301
|
stateRef.current = state;
|
|
298
302
|
});
|
|
299
303
|
|
|
304
|
+
const isNavigationReady = isReady();
|
|
305
|
+
|
|
306
|
+
React.useEffect(() => {
|
|
307
|
+
if (isNavigationReady) {
|
|
308
|
+
onReadyRef.current?.();
|
|
309
|
+
}
|
|
310
|
+
}, [isNavigationReady]);
|
|
311
|
+
|
|
300
312
|
React.useEffect(() => {
|
|
301
313
|
const hydratedState = getRootState();
|
|
302
314
|
|
|
@@ -376,7 +388,7 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
376
388
|
isFirstMountRef.current = false;
|
|
377
389
|
}, [getRootState, emitter, state]);
|
|
378
390
|
|
|
379
|
-
const defaultOnUnhandledAction =
|
|
391
|
+
const defaultOnUnhandledAction = useLatestCallback(
|
|
380
392
|
(action: NavigationAction) => {
|
|
381
393
|
if (process.env.NODE_ENV === 'production') {
|
|
382
394
|
return;
|
|
@@ -415,38 +427,30 @@ const BaseNavigationContainer = React.forwardRef(
|
|
|
415
427
|
message += `\n\nThis is a development-only warning and won't be shown in production.`;
|
|
416
428
|
|
|
417
429
|
console.error(message);
|
|
418
|
-
}
|
|
419
|
-
[]
|
|
430
|
+
}
|
|
420
431
|
);
|
|
421
432
|
|
|
422
|
-
|
|
423
|
-
<
|
|
424
|
-
<
|
|
425
|
-
<
|
|
426
|
-
<
|
|
427
|
-
<
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
433
|
+
return (
|
|
434
|
+
<NavigationIndependentTreeContext.Provider value={false}>
|
|
435
|
+
<NavigationContainerRefContext.Provider value={navigation}>
|
|
436
|
+
<ScheduleUpdateContext.Provider value={scheduleContext}>
|
|
437
|
+
<NavigationBuilderContext.Provider value={builderContext}>
|
|
438
|
+
<NavigationStateContext.Provider value={context}>
|
|
439
|
+
<UnhandledActionContext.Provider
|
|
440
|
+
value={onUnhandledAction ?? defaultOnUnhandledAction}
|
|
441
|
+
>
|
|
442
|
+
<DeprecatedNavigationInChildContext.Provider
|
|
443
|
+
value={navigationInChildEnabled}
|
|
444
|
+
>
|
|
445
|
+
<EnsureSingleNavigator>{children}</EnsureSingleNavigator>
|
|
446
|
+
</DeprecatedNavigationInChildContext.Provider>
|
|
447
|
+
</UnhandledActionContext.Provider>
|
|
448
|
+
</NavigationStateContext.Provider>
|
|
449
|
+
</NavigationBuilderContext.Provider>
|
|
450
|
+
</ScheduleUpdateContext.Provider>
|
|
451
|
+
</NavigationContainerRefContext.Provider>
|
|
452
|
+
</NavigationIndependentTreeContext.Provider>
|
|
436
453
|
);
|
|
437
|
-
|
|
438
|
-
if (independent) {
|
|
439
|
-
// We need to clear any existing contexts for nested independent container to work correctly
|
|
440
|
-
element = (
|
|
441
|
-
<NavigationRouteContext.Provider value={undefined}>
|
|
442
|
-
<NavigationContext.Provider value={undefined}>
|
|
443
|
-
{element}
|
|
444
|
-
</NavigationContext.Provider>
|
|
445
|
-
</NavigationRouteContext.Provider>
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
return element;
|
|
450
454
|
}
|
|
451
455
|
);
|
|
452
456
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
import NavigationContext from './NavigationContext';
|
|
4
|
+
import NavigationIndependentTreeContext from './NavigationIndependentTreeContext';
|
|
5
|
+
import NavigationRouteContext from './NavigationRouteContext';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component to make the child navigation container independent of parent containers.
|
|
9
|
+
*/
|
|
10
|
+
export default function NavigationIndependentTree({
|
|
11
|
+
children,
|
|
12
|
+
}: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
// We need to clear any existing contexts for nested independent container to work correctly
|
|
17
|
+
<NavigationRouteContext.Provider value={undefined}>
|
|
18
|
+
<NavigationContext.Provider value={undefined}>
|
|
19
|
+
<NavigationIndependentTreeContext.Provider value>
|
|
20
|
+
{children}
|
|
21
|
+
</NavigationIndependentTreeContext.Provider>
|
|
22
|
+
</NavigationContext.Provider>
|
|
23
|
+
</NavigationRouteContext.Provider>
|
|
24
|
+
);
|
|
25
|
+
}
|