How to access URL params in a server component. #67253
Unanswered
alawi2306
asked this question in
App Router
Replies: 1 comment
-
you can use headers function from next js for server components and get all needed headers sent from browser to your server; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This may have been answered already, but I have had this issue for so long
.
I need to retrieve a single post based on the URL params, but useParams is a client side hook, and of course you can't use client side components asynchronously.
There is an open discussion that only deals with the page router:
#51818
Therefore here is what I am currently doing:
This therefore results in a 60 on the lighthouse page speed performance metric.
Does anyone have any idea how to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions