Detecting notFound() in layout.ts
Unanswered
Toy Fox Terrier posted this in #help-forum
Toy Fox TerrierOP
Quick question: In layout.ts is there a way to detect that the render was triggered by notFound()?
3 Replies
American black bear
What are you trying to achieve? I suppose there is no way you can do this, however you can detect if you are redirected to your 404 page.
Toy Fox TerrierOP
I want set a few different components and props for the components to be rendered. How can I detect the redirect?
American black bear
I still don't get what you are trying to achieve. You can just use
not-found.tsx
to display custom UI you want on notFound()
.