useRouter hook documentation needed
See original GitHub issueThis needs documentation. Also needs an explanation of removing withRouter HOC with this alternative.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:7 (6 by maintainers)
Top Results From Across the Web
useRouter React Hook - useHooks
We bring you easy to understand React Hook code recipes so you can learn how React hooks work and feel more comfortable writing...
Read more >next/router | Next.js
useRouter is a React Hook, meaning it cannot be used with classes. You can either use withRouter or wrap your class in a...
Read more >Using Hooks with React Router - LogRocket Blog
In this tutorial, you'll learn how to use Hooks with React Router and minimize the number of code lines in a component. Let's...
Read more >How to use "useRouter()" from next.js in a class component?
I would recommend to use withRouter HOC as per next.js documentation: use the useRouter hook, or withRouter for class components.
Read more >Add useRouter Hook · Issue #6430 · remix-run/react-router
https://reactjs.org/docs/hooks-faq.html#what-do-hooks-mean-for- ... No polyfill required, you just can't use useRouter unless you're on 16.7 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@avetisk fixing that issue is in-progress: https://github.com/zeit/next.js/pull/7732
Closing this since the hook is now documented.
@hlebbobulka @timneutkens The documentation is added here: https://github.com/zeit/next.js/pull/7602 so I think this can be closed.