Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitccb188a

Browse files
Divyendu Singhtimneutkens
Divyendu Singh
authored andcommitted
Update withData.js - support withRouter HOC (vercel#3286)
Add support for using withRouter as HOC with this example.Passing router context manually fixes this, based on,vercel#2908 (comment)
1 parent5260736 commitccb188a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎examples/with-apollo-auth/lib/withData.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ export default ComposedComponent => {
5454
<ComposedComponenturl={url}{...composedInitialProps}/>
5555
</ApolloProvider>
5656
)
57-
awaitgetDataFromTree(app)
57+
awaitgetDataFromTree(app,{
58+
router:{
59+
query:context.query,
60+
pathname:context.pathname,
61+
asPath:context.asPath
62+
}
63+
})
5864

5965
// Extract query data from the Apollo's store
6066
conststate=apollo.getInitialState()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp