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: 3 comments 7 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
7 replies
@Set27
Comment options

@Venipa
Comment options

@2333Ge
Comment options

@Venipa
Comment options

@2333Ge
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants