Skip to content

Commit bf1f8ae

Browse files
committed
fix: Wrap hydrateRoot in a React Transition.
1 parent 1e1b00a commit bf1f8ae

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/react/src/runtime/pages-client.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, {
22
Suspense,
3+
startTransition,
34
use,
45
useCallback,
56
useEffect,
@@ -581,10 +582,12 @@ export async function startReactPages(config: ReactPagesConfig): Promise<ReactPa
581582
throw new Error('pages: Missing #app element for Void React pages hydration.');
582583
}
583584

584-
hydrateRoot(
585-
appEl,
586-
React.createElement(App, { engine, router, viewTransitions: config.viewTransitions }),
587-
);
585+
startTransition(() => {
586+
hydrateRoot(
587+
appEl,
588+
React.createElement(App, { engine, router, viewTransitions: config.viewTransitions }),
589+
);
590+
});
588591
appEl.setAttribute('data-hydrated', 'true');
589592
engine.start();
590593

0 commit comments

Comments
 (0)