Conditional rendering on base of url #71296
Unanswered
alihamasdev
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
I have a
page.tsxfile in app directory. This page is a server component and renders the homepage which also have some links to pages. Now,appdirectory has a group route ofauth-modelswhich have all the models in different route which are login, signup and forgot-password. In thelayout.tsxfile i made a model and pass children to it so i don't have to add dialog in each and every route. One more thing i do is import the rootpage.tsxfile in here and add it before dialog box. So in the background it shows that home page just like twitter. Code is working fine here. But i want to show root page in (auth-models) only if user comes from homepage (so the homepage renders there). If users comes straight to /login or /signup, root page shouldn’t render in that case. How can i so this?Folder stucture
Code
Beta Was this translation helpful? Give feedback.
All reactions