How can I detect if a route exists with NextJS?
Unanswered
Indian oil sardine posted this in #help-forum
Indian oil sardineOP
Hi people. I'm working in a project with Typescript and Next.js but I don't know how to check if a route exists. The purpose is to build a breadcrumb where the user can click only in pages that exists. Pages that doesn't exist can't be clicked.
My current breadcrumbs implementation:
https://ideone.com/eU4DwV
(Obs: I set JavaScript in Ideone but its essentially TypeScript ok)
(Obs2: I'm getting the failed to parse error in the uri string. I don't know what is causing this).
My current breadcrumbs implementation:
https://ideone.com/eU4DwV
(Obs: I set JavaScript in Ideone but its essentially TypeScript ok)
(Obs2: I'm getting the failed to parse error in the uri string. I don't know what is causing this).
1 Reply
Indian oil sardineOP
Obs3: If I remove the catch sentence, the console prints the promises as successful but, in some way, the links doesn't work yet.