You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all of these are for the pages router. not the app router
implement a pop() function on the useRouter in next/link to make it easier to handle removing the end of the url, especially when using dynamic routes.
for example: /blog/[slug]/edit
pop function will take you to blog/[slug]
current method is quite tedious:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
all of these are for the pages router. not the app router
pop()
function on theuseRouter
innext/link
to make it easier to handle removing the end of the url, especially when using dynamic routes.for example:
/blog/[slug]/edit
pop function will take you to
blog/[slug]
current method is quite tedious:
append()
function to theuseRouter
innext/link
to make it easier to append to urls when using dynamic routes.for example:
blog/[slug]
append('edit')
should take you toblog/[slug]/edit
current method:
just in general, handling with the router when using dynamic routes is very confusing and error prone. there should be easier ways to handle this.
if I missed a feature that already exists, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions