Next.js Discord

Discord Forum

Next Router `as` prop

Answered
Common paper wasp posted this in #help-forum
Open in Discord
Common paper waspOP
Hey guys, maybe I am a little bit stupid, but I just don't get it, what is the matter of as property in router.push method and router <Link> component?
Answered by Rafael Almeida
afaik the as prop has been discontinued in both these features. it used to be useful to mask a dynamic route because you had to add the filesystem path:
router.push('/page/[id]', '/page/123', ...)
// now you can just do
router.push('/page/123')
View full answer

1 Reply

afaik the as prop has been discontinued in both these features. it used to be useful to mask a dynamic route because you had to add the filesystem path:
router.push('/page/[id]', '/page/123', ...)
// now you can just do
router.push('/page/123')
Answer