Next.js Discord

Discord Forum

how can i access the url path

Unanswered
mailar posted this in #help-forum
Open in Discord
The problem is that if I try to access route /en next.js will display 404 error in black background. So what im trying to do is if the user has defined language like /en in the url then i want to use that language in my Navbar component and if not then just use 'en' by default. Here's the picture what I tried to do. You don't need to know anything about the Navbar component i just want to pass the language property there and in that end i have switch case for the language and other logic.

0 Replies