From ccb188ab6b7bac3814a2b39400b4a917d6fec97c Mon Sep 17 00:00:00 2001 From: Divyendu Singh Date: Wed, 15 Nov 2017 15:14:06 +0530 Subject: [PATCH] Update withData.js - support withRouter HOC (#3286) Add support for using withRouter as HOC with this example. Passing router context manually fixes this, based on, https://github.com/zeit/next.js/issues/2908#issuecomment-338244804 --- examples/with-apollo-auth/lib/withData.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/with-apollo-auth/lib/withData.js b/examples/with-apollo-auth/lib/withData.js index d818e83338993..c12f2f4e20956 100644 --- a/examples/with-apollo-auth/lib/withData.js +++ b/examples/with-apollo-auth/lib/withData.js @@ -54,7 +54,13 @@ export default ComposedComponent => { ) - await getDataFromTree(app) + await getDataFromTree(app, { + router: { + query: context.query, + pathname: context.pathname, + asPath: context.asPath + } + }) // Extract query data from the Apollo's store const state = apollo.getInitialState()