diff --git a/packages/runtime/plugin-runtime/src/core/context/runtime.ts b/packages/runtime/plugin-runtime/src/core/context/runtime.ts index 33342086737..7fa6c477860 100644 --- a/packages/runtime/plugin-runtime/src/core/context/runtime.ts +++ b/packages/runtime/plugin-runtime/src/core/context/runtime.ts @@ -42,6 +42,7 @@ export const ServerRouterContext = createContext({} as any); export interface TRuntimeContext extends Partial { initialData?: Record; + isBrowser: boolean; context: TSSRContext; /** @deprecated use context.request field instead */ request?: SSRServerContext['request']; @@ -49,10 +50,6 @@ export interface TRuntimeContext extends Partial { response?: SSRServerContext['response']; // store type store?: Store; - router?: { - navigate: Router['navigate']; - location: RouterState['location']; - }; [key: string]: any; } diff --git a/packages/runtime/plugin-runtime/src/router/runtime/plugin.node.tsx b/packages/runtime/plugin-runtime/src/router/runtime/plugin.node.tsx index 12fddcede5f..b32890807af 100644 --- a/packages/runtime/plugin-runtime/src/router/runtime/plugin.node.tsx +++ b/packages/runtime/plugin-runtime/src/router/runtime/plugin.node.tsx @@ -180,27 +180,6 @@ export const routerPlugin = ( return getRouteApp(); }, - pickContext: pickedContext => { - const { remixRouter } = pickedContext; - - // remixRouter is not existed in conventional routes - if (!remixRouter) { - return pickedContext; - } - - // only export partial common API from remix-router - const router = { - navigate: remixRouter.navigate, - get location() { - return remixRouter.state.location; - }, - }; - - return { - ...pickedContext, - router, - }; - }, }; }, }; diff --git a/packages/runtime/plugin-runtime/src/router/runtime/plugin.tsx b/packages/runtime/plugin-runtime/src/router/runtime/plugin.tsx index cbb7a008796..5bd755517e7 100644 --- a/packages/runtime/plugin-runtime/src/router/runtime/plugin.tsx +++ b/packages/runtime/plugin-runtime/src/router/runtime/plugin.tsx @@ -194,29 +194,6 @@ export const routerPlugin = ( return getRouteApp(); }, - pickContext: pickedContext => { - const { remixRouter } = pickedContext; - - // two scenarios: 1. remixRouter is not existed in conventional routes; - // 2. useRuntimeContext can be called by users before hoc hooks execute - if (!remixRouter) { - return pickedContext; - } - - // only export partial common API from remix-router - const router = { - ...pickedContext.router, - navigate: remixRouter.navigate, - get location() { - return remixRouter.state.location; - }, - }; - - return { - ...pickedContext, - router, - }; - }, }; }, };