`app/page.tsx` is not loading
Answered
jaggi73 posted this in #help-forum
jaggi73OP
I have a folder structure as follows
Next is loading
instead of
- app
- layout.tsx
- page.tsx (client component)
- directory
- page.tsxNext is loading
app/layout.tsx > app/directory/page.tsxinstead of
app/layout.tsx > app/page.tsx > app/directory/page.tsxAnswered by fuma
app/page.tsx shouldn't be loaded when opening /directory, page is not layout12 Replies
jaggi73OP
What seems to be the issue?
Ive tried clearing cache as well
it is correct, what is your problem?
@fuma it is correct, what is your problem?
jaggi73OP
the file
app/page.tsx is not loading altogetherapp/page.tsx shouldn't be loaded when opening /directory, page is not layoutAnswer
jaggi73OP
its skipping directly to
app/directory/page.tsxHave you read the docs? I don't sure what is your definition of "load", but if you are referring to "render", it is an expected behaviour
jaggi73OP
Ahh, i made a silly mistake
thank you for pointing it out!
@fuma `app/page.tsx` shouldn't be loaded when opening `/directory`, page is not layout
jaggi73OP
whats the best file to add a root level useEffect call since app/layout.tsx cannot be made 'use client'?
You can have client components in a server component, just create the component and put it into your root layout.