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

useRouter could use more abstractions #11

Open
Seanmclem opened this issue Sep 19, 2024 · 2 comments
Open

useRouter could use more abstractions #11

Seanmclem opened this issue Sep 19, 2024 · 2 comments

Comments

@Seanmclem
Copy link

Seanmclem commented Sep 19, 2024

The hand full of abstractions on useRouter https://unitools.geekyants.com/packages/router#props

are kind of bare bones. We have push, replace, back, and navigate?

I'm having to create my own native/web wrappers for things like url params and such. This hook could use more love. It feels forgotten.

@amrya200t
Copy link

Can you share your solution with us? 😁

@alex-reusables
Copy link

alex-reusables commented Jan 30, 2025

Yeah I also have this question right now, using the next/router yields a router not mounted error so I'm now somewhat confused about how this all works lol

Edit: ok turns out you get route params as props on the page component kind like:

export function MyPage({ params }: { params: { id: string } }) {} so I can access the id in the url if I nest my file like so:

/dashboard/location/[id]/page.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants