[legacy-framework] Added params and query to useRouter and withRouter#677
Conversation
…https://github.com/toshi1127/blitz into added-params-and-query-to-use-router-and-with-router
|
Should update the documentation and implement the test code in this PR? |
flybayer
left a comment
There was a problem hiding this comment.
Awesome, thank you @toshi1127!!
I've left a few initial comments. I'll do a more in depth review and testing within a day or two.
It's not a big deal, but I think all the renamed imports like WithRouterPropsNext would be better formatted as useNextRouter instead of useRouterNext. Because here in English "Next" is an adjective describing "Router", so "next" should be before "router" :)
packages/core/src/with-router.tsx
Outdated
| @@ -0,0 +1,22 @@ | |||
| import React from 'react' | |||
| import {withRouter as withRouterNext, NextRouter as NextRouterNext} from 'next/router' | |||
There was a problem hiding this comment.
You only need 'next' one time in NextRouterNext :D
There was a problem hiding this comment.
Admittedly, this renaming is unnecessary.
Fixed.
|
Thanks for the review !! |
|
@toshi1127 awesome, looks great! One last thing. Can you open a PR to update the router object documentation for this? Here's the file on Github |
|
@flybayer |
|
Created a PR to update the documentation of the router object. |
|
Great, thank you! :) |
|
@all-contributors add @toshi1127 for docs |
|
I've put up a pull request to add @toshi1127! 🎉 |
params and query to useRouter and withRouterparams and query to useRouter and withRouter
This PR closes the issue of Add
paramsandquerytouseRouterandwithRouter. blitz-js/legacy-framework#936What are the changes and their implications?
Extend useRouter and withRouter with useParams and useRouterQuery hooks.
Current:
Change to:
Checklist
routerobject'squeryandparamsblitzjs.com#82