From fc89593b486df046087fa46fed0c85ab6cc8bc87 Mon Sep 17 00:00:00 2001 From: ByteAtATime Date: Thu, 27 Nov 2025 20:31:01 -0800 Subject: [PATCH] feat: add suspense root in nav stack --- renderer/src/api/navigation.tsx | 8 +++++++- renderer/src/reconciler.ts | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/renderer/src/api/navigation.tsx b/renderer/src/api/navigation.tsx index 2aeab46..9e4167a 100644 --- a/renderer/src/api/navigation.tsx +++ b/renderer/src/api/navigation.tsx @@ -1,6 +1,7 @@ import { createContext, Fragment, + Suspense, useCallback, useContext, useEffect, @@ -10,6 +11,7 @@ import { } from "react"; import * as protocol from "../protocol"; import { setNavigationPop } from "../index"; +import { List } from "./components"; declare module "react/jsx-runtime" { namespace JSX { @@ -95,7 +97,11 @@ export const NavigationRoot: React.FC<{ children: ReactNode }> = (props) => { {routes.map((route) => ( - {route.component} + + }> + {route.component} + + ))} diff --git a/renderer/src/reconciler.ts b/renderer/src/reconciler.ts index 203e493..1410361 100644 --- a/renderer/src/reconciler.ts +++ b/renderer/src/reconciler.ts @@ -199,6 +199,16 @@ const HostConfig: Reconciler.HostConfig< detachDeletedInstance() {}, getPublicInstance: (instance) => instance, + + scheduleTimeout: setTimeout, + cancelTimeout: clearTimeout, + noTimeout: -1, + + maySuspendCommit: () => false, + preloadInstance: () => true, + startSuspendingCommit: () => {}, + suspendInstance: () => {}, + waitForCommitToBeReady: () => null, }; const reconciler = Reconciler(HostConfig);