#Using Client component in layout.js
62 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)
because the layout loads data, and the redirecting takes like 3 mins
i want it to go to a different route instantly
It probably happens in development. Have you tried in production?
its still slow
it doesnt feel smooth
It won't make much difference. just rendering will take time
but like how are other websites extremely fast in switching routes
You can add "use client"; at the top and try it out then
any examples?
but people hate me when i use a client component as parent
Ya, I'll also hate you
so what do i do to increase speed
Not instantly, but roughly 0.5s, till it gets data from the server
but the website itself feels smooth
as in it shows those loading components
it doesnt buffer the whole page
Can you give a minimum repro repo on where you face speed issues? Because I don't face any
i clicked sell
and it took like 5 secs
to redirect
on production
i feel like its because of server components
Are you using the Link element for urls?
Thats the reason!
With my personal experience, Link is faster!
but like <Link> is even slower than a tags
Have you tried it?
yea
i initially had that
Link doesnt even show any sort of loading
<a> atleast shows that the website buffers
its also slower
idk
whats the cause
I'll need a min reproduction repo
because its a unexpected behaviour
and whats your nextjs version
latest
Just create a minimum reproduction repo & send it here
idk how to do that lol
you can google it!
can u give me some advice
is it fine if i fetch data in layout
and pass it
but idk how to pass it to children
no
you should delete above messages ASAP
ignore it then, if you don't want to.