Skip to content

In app router, server component, how can I get the current url (similar of window.location) #63587

Discussion options

You must be logged in to vote

request.nextUrl.pathname;

For more, here

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by GuyAvraham
Comment options

You must be logged in to vote
5 replies
@GuyAvraham
Comment options

@2333Ge
Comment options

@Set27
Comment options

@Venipa
Comment options

@2333Ge
Comment options

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