Skip to content
Discussion options

You must be logged in to vote

withRouter uses the React Context API to provide the router state to your component, therefore if the component you are rendering is not within Next's component tree (i.e. a child of the Context provider) then you cannot access that Context's state via withRouter.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@timneutkens
Comment options

Answer selected by timneutkens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants