next.js: Not getting `url.query` in custom parametrised server route
Expected behavior
Got to detail/post-id and see rendered post detail. (server should wait until data is fetched and then return post detail)
Actual behavior
Go to detail/post-id and see spinner then see post detail. (server does not wait until data is fetched and renders spinner client then renders post detail)

About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 19 (4 by maintainers)
Thank you @developer239 !
Your solution was ok, but the url should be placed on composedInitialProps after the
otherwise it would be replaced.
the thing there is that Next only knows the page
/detail,/detail?id=cjdg4ro6z2zfb0154l6jubt89is the same page but with a query param butdetail/cjdg4ro6z2zfb0154l6jubt89is a different page for Next.Basically, you need to send more parameters to
<Link>like here or use a lib like next-routesOh, I’m sorry for not being clear. The issue is that ComposedComponent is only getting the props inside { …composedInitialProps } and unless you have
urlthere you’re actually not sendingurlto the component during the execution ofgetDataFromTreethat happens beforegetInitialPropsends.Hello!, some questions:
Are you sending
urlin props ? (I can’t see it anywhere) Does it happens always or only on client side navigation ?