From 3986b3ca4ca67604da73c1280acdda3f45e8f5d3 Mon Sep 17 00:00:00 2001 From: Marco Wettstein Date: Sat, 5 Mar 2022 10:26:02 +0100 Subject: [PATCH] fix: router is undefined in page props fixes https://github.com/lfades/next-with-apollo/issues/181 --- src/withApollo.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/withApollo.tsx b/src/withApollo.tsx index 6e273b1..f7a659d 100644 --- a/src/withApollo.tsx +++ b/src/withApollo.tsx @@ -33,12 +33,8 @@ export default function withApollo( const render = pageOptions.render || options.render; const onError = pageOptions.onError || options.onError; - function WithApollo({ - apollo, - apolloState, - router, - ...props - }: ApolloProps) { + function WithApollo({ apollo, apolloState, ...props }: ApolloProps) { + const router = props.router; const apolloClient = apollo || initApollo(client, {