diff --git a/src/NavigationNestedProvider.tsx b/src/NavigationNestedProvider.tsx
index ab68c4e..94c154a 100644
--- a/src/NavigationNestedProvider.tsx
+++ b/src/NavigationNestedProvider.tsx
@@ -18,9 +18,8 @@ function NavigationNestedProvider({ children }: { children: any }) {
const id = React.useId();
const rootKey = 'navigationModalProvider_' + id.replace(':', '--');
const { theme } = React.useContext(OptimizedContext);
- const { screens, navigationRoot, ...rest } = React.useContext(
- RidgeNavigationContext
- );
+ const { screens, navigationRoot, SuspenseContainer, ...rest } =
+ React.useContext(RidgeNavigationContext);
const rootNavigator = React.useMemo(() => {
const stateInfos = [
@@ -36,7 +35,11 @@ function NavigationNestedProvider({ children }: { children: any }) {
route: makeVariablesNavigationFriendly(
rootKeyAndPaths(rootKey, screen.path)
),
- renderScene: () => ,
+ renderScene: () => (
+
+
+
+ ),
trackCrumbTrail: true,
preloadId: screen.path,
})),
@@ -48,7 +51,7 @@ function NavigationNestedProvider({ children }: { children: any }) {
navigator.navigate(rootKey);
return navigator;
- }, [rootKey, screens]);
+ }, [SuspenseContainer, rootKey, screens]);
const navigationRootWithModal = React.useMemo(
() => ({
@@ -67,6 +70,7 @@ function NavigationNestedProvider({ children }: { children: any }) {
value={{
screens,
...rest,
+ SuspenseContainer,
rootNavigator,
navigationRoot: navigationRootWithModal,
}}
@@ -81,11 +85,7 @@ function NavigationNestedProvider({ children }: { children: any }) {
return (
<>
-
+
{state.key === rootKey ? children : state.renderScene()}
>
diff --git a/src/NavigationProvider.tsx b/src/NavigationProvider.tsx
index bc31972..e9327ab 100644
--- a/src/NavigationProvider.tsx
+++ b/src/NavigationProvider.tsx
@@ -155,7 +155,11 @@ export default function NavigationProvider({
route: makeVariablesNavigationFriendly(
getScreenKey(rootKey, tab, screen.path)
),
- renderScene: () => ,
+ renderScene: () => (
+
+
+
+ ),
trackCrumbTrail: !isTheSame,
screen,
preloadId: screen.path,
@@ -171,7 +175,11 @@ export default function NavigationProvider({
key: rootKey,
route: rootKey,
trackCrumbTrail: false,
- renderScene: () => ,
+ renderScene: () => (
+
+
+
+ ),
screen: root.child,
preload: () => preloadRoot(rootKey),
preloadId: root.child.path,
@@ -181,7 +189,11 @@ export default function NavigationProvider({
route: makeVariablesNavigationFriendly(
rootKeyAndPaths(rootKey, screen.path)
),
- renderScene: () => ,
+ renderScene: () => (
+
+
+
+ ),
trackCrumbTrail: true,
screen,
preloadId: screen.path,
@@ -191,7 +203,7 @@ export default function NavigationProvider({
})
.flat();
return new StateNavigator(navigators, getHistoryManager(basePath));
- }, [basePath, navigationRoot, preloadRoot, screens]);
+ }, [SuspenseContainer, basePath, navigationRoot, preloadRoot, screens]);
const preloadLink = React.useCallback(
(url: string) => {
@@ -333,11 +345,7 @@ export default function NavigationProvider({
{children && (
-
+
{children}
)}
diff --git a/src/contexts/OptimizedContext.tsx b/src/contexts/OptimizedContext.tsx
index 0407047..1ce0414 100644
--- a/src/contexts/OptimizedContext.tsx
+++ b/src/contexts/OptimizedContext.tsx
@@ -23,12 +23,10 @@ export function OptimizedContextProvider({
data,
state,
children,
- withSuspenseContainer = true,
}: {
data: any;
state: State | null;
children: any;
- withSuspenseContainer?: boolean;
}) {
const {
preloadedCache,
@@ -37,7 +35,6 @@ export function OptimizedContextProvider({
preloadScreen,
preloadElement,
theme,
- SuspenseContainer,
} = React.useContext(RidgeNavigationContext);
const {
stateNavigator,
@@ -73,11 +70,7 @@ export function OptimizedContextProvider({
);
return (
- {withSuspenseContainer ? (
- {children}
- ) : (
- {children}
- )}
+ {children}
);
}