#layout.tsx without a page.tsx?
27 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
can you explain why you want that?
its for shallow-routing basicly
i dont want any full refresh to happen in that specific url or child-urls
That URL will basically be cached on the client side
once its visited
What i meant is that i dont want the components to re-render, therefore i am placing like nav-bar in my layout.tsx
and i dont need anything in my page.tsx
yeah thats good
but back to my original question
"use client" export default function UserPage() { return null }
do i need to have the page.tsx? or is there a workaround to only use the layout.tsx?
- your page.tsx should not be clientside. 2. yes ofc
page.tsx is essential for the nextjs app router
u cant define a route without it, as far as i know
aha okay
i guess i will just keep retuning Null then
ye once i remove it i get 404 error
oh why?
its mainly because i only use the {children} elements inside layout.tsx
ye i guess 😄
cool
ty guys for answering
This question has been marked as answered! If you have any other questions, feel free to create another post
[Click here](#1294688581180461147 message)