Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update withData.js - support withRouter HOC #3286

Merged
merged 1 commit into from
Nov 15, 2017
Merged

Update withData.js - support withRouter HOC #3286

merged 1 commit into from
Nov 15, 2017

Conversation

divyenduz
Copy link

Add support for using withRouter as HOC with this example.

Passing router context manually fixes this, based on, #2908 (comment)

This PR #3149, it it released yet? I am on 4.1.4 and I still require the above fix to make it work.

Add support for using withRouter as HOC with this example.

Passing router context manually fixes this, based on, #2908 (comment)
@@ -54,7 +54,13 @@ export default ComposedComponent => {
<ComposedComponent url={url} {...composedInitialProps} />
</ApolloProvider>
)
await getDataFromTree(app)
await getDataFromTree(app, {
router: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this break when you don't wrap withData in a withRouter?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it does not break, I have various pages/components, some wrapped, some not wrapped.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks 👍

@timneutkens timneutkens merged commit ccb188a into vercel:master Nov 15, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants