diff options
author | 2021-11-23 16:23:31 -0500 | |
---|---|---|
committer | 2021-11-23 16:23:31 -0500 | |
commit | ca25e32c0f4de45584982eeb4bad9f2fa5422b8a (patch) | |
tree | e26b039d1f060c793a14f651a76d789ce57bae38 /packages/bun-framework-next | |
parent | 5a1f60c729f9e9d4b987d552a45f510a738a1805 (diff) | |
download | bun-ca25e32c0f4de45584982eeb4bad9f2fa5422b8a.tar.gz bun-ca25e32c0f4de45584982eeb4bad9f2fa5422b8a.tar.zst bun-ca25e32c0f4de45584982eeb4bad9f2fa5422b8a.zip |
fix shallow routing
Diffstat (limited to '')
-rw-r--r-- | packages/bun-framework-next/client.development.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/bun-framework-next/client.development.tsx b/packages/bun-framework-next/client.development.tsx index 187a91e71..29774d1b5 100644 --- a/packages/bun-framework-next/client.development.tsx +++ b/packages/bun-framework-next/client.development.tsx @@ -52,8 +52,6 @@ import { export const emitter: MittEmitter<string> = mitt(); -const App = NextApp; - declare global { interface Window { /* test fns */ @@ -293,6 +291,7 @@ export async function _boot(EntryPointNamespace, isError) { // Construct signature return types 'App<any, any, any>' and 'Component<AppProps, any, any>' are incompatible. // @ts-expect-error CachedApp = NextApp; + CachedComponent = PageComponent; if (appScripts && appScripts.length > 0) { let appSrc; @@ -329,9 +328,12 @@ export async function _boot(EntryPointNamespace, isError) { return render( Object.assign< {}, - Omit<RenderRouteInfo, "App" | "scroll">, - Pick<RenderRouteInfo, "App" | "scroll"> + Omit<RenderRouteInfo, "App" | "scroll" | "Component">, + Pick<RenderRouteInfo, "App" | "scroll" | "Component"> >({}, info, { + // If we don't have an info.Component, we may be shallow routing, + // fallback to current entry point + Component: info.Component || CachedComponent, App, scroll, }) |