Add useRouter Hook
See original GitHub issueHi guys,
at current React Conf Hooks have been announced for React v16.7. What’s the plan for supporting them? Will there be a useRouter() any time soon?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:231
- Comments:62 (16 by maintainers)
Top Results From Across the Web
useRouter React Hook
Hooks are a feature in React that allow you use state and other React features without writing classes. This website provides easy to...
Read more >useRouter hook
React Hook API for react-router, realized with useContext. react. usecontext. router. hook. userouter ... Environmentcreate-react-app.
Read more >useRouter
The useRouter hook is used for managing client-side routing and accessing browser history. Import. @getshogun/frontend-hooks is already pre-installed on every ...
Read more >Add useRouter Hook · Issue #6430 · remix-run/react-router
Hi guys, at current React Conf Hooks have been announced for React v16.7. What's the plan for supporting them? Will there be a...
Read more >Client Component Hooks: useRouter | Next.js
useRouter (). router.push(href: string) : Perform a client-side navigation to the provided route. Adds a new entry into the browser's history stack.
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

We’re not making any progress here, so I’m going to close this. We will have a few hooks in the next major release, maybe even in a minor release. If you absolutely cannot wait, please be my guest and use some other router that ships with hooks.
You could also create your own wrapper to get access:
Then wrap this around your App instead of the normal
<BrowserRouter />Then you can make a useRouter hook: