I absolutely love your content Nextjs is easily one of the most in demand tech currently and you're providing one of most clear and concise resources for learning it all the way from the basics to the more advanced topics I hope your channel continues to grow, you deserve every success
@hamedbahram Жыл бұрын
Thanks Kyle! I appreciate your comment, and I'm glad you're finding the videos helpful.
@andrew_schaeffer Жыл бұрын
Wonderful lesson thank you. I'm reading throught the NextJS docs now and am so glad you cleared up the difference between layouts and templates.
@hamedbahram Жыл бұрын
My pleasure! Glad it was helpful.
@uzairahmed297510 ай бұрын
Thank you Hamed, This video makes a lot of sense to understand between layout and template.
@hamedbahram10 ай бұрын
Glad it was helpful!
@rohitghodeswar11 Жыл бұрын
Again top notch content on NextJS Thank you, keep it up 👍🏻
@hamedbahram Жыл бұрын
My pleasure!
@Gangbuster74 Жыл бұрын
congratulation for reaching 10k subs well deserving, your content is really great explaing all the bits and pieces of front end development
@hamedbahram Жыл бұрын
Thanks! I appreciate it.
@devmab Жыл бұрын
Thank you so much for your support and teaching, I'm really understanding your explanations.
@hamedbahram Жыл бұрын
You are very welcome. Glad to hear that!
@albert21994 Жыл бұрын
Clear and understandable examples. Thank you!
@hamedbahram Жыл бұрын
Glad it was helpful!
@anversadutt Жыл бұрын
congrats bro for the 10K, keep rocking :)
@hamedbahram Жыл бұрын
Thank you so much 😀
@hasancheraghi2800 Жыл бұрын
Thank you Hamed. I appreciate your fantastic tutorial
@hamedbahram Жыл бұрын
Anytime Hasan! I'm glad it was helpful.
@nikhilpsathyanathan Жыл бұрын
I thought it just like layout but this video is awesome. Got to know more about template' functionality
@hamedbahram Жыл бұрын
Glad it was helpful!
@afshinkaramifar4429 Жыл бұрын
Such a great explanation, Well done Hamed👏
@hamedbahram Жыл бұрын
Thank you! 🫡
@onyejemeemmanuel945 ай бұрын
Nice content. Thanks for explaining concept well
@hamedbahram5 ай бұрын
Glad it was helpful!
@AhmedMohamed-q3v4o Жыл бұрын
Best regards from Egypt
@hamedbahram Жыл бұрын
Welcome to the channel!
@tysondolan15335 ай бұрын
You are a great instructor!
@hamedbahram5 ай бұрын
I appreciate that!
@any_account-b6x4 ай бұрын
Finally I understood that, thank you! 🙂
@hamedbahram4 ай бұрын
Glad it helped!
@LorenzoSemorile11 ай бұрын
Hi, thanks for the video. I was trying to use template "server side" but unfortunatly when you navigate with LInk component, the template it seems no refresh some other ""server side" component inside. Why? Thanks for the answer.
@hamedbahram11 ай бұрын
The template itself would re-render on every navigation but the server components inside are cached by default. There are different ways to opt your page components into dynamic rendering, but the easiest way is to use the `noStore` function. You can read about it here → nextjs.org/docs/app/api-reference/functions/unstable_noStore
@LorenzoSemorile11 ай бұрын
@@hamedbahram thanks a lot. I will try tomorrow and i will let you know. Sorry I’m learning nextjs framework in theese days. Thanks for your videos.
@hamedbahram11 ай бұрын
@@LorenzoSemorile Glad to help!
@tatsumii1420 Жыл бұрын
we would love a framer motion video with nextjs
@hamedbahram Жыл бұрын
Absolutely! That has been overdue. Will work on it.
@t2e0j0a4 Жыл бұрын
Hi really loved video. By the way what is the font u are using for VS Code editor
@hamedbahram Жыл бұрын
Thanks! I'm using Operator mono.
@Felipe-pb9gu Жыл бұрын
Loving your videos, great content and well explained. Have a question, if you convert the template or the layout into a client component will all the childrens be client components too?
@hamedbahram Жыл бұрын
Thank! Glad to hear that. Re your question: only if you import a server component inside a client component will they turn into client components. You can pass server components as children as I did in the video without effecting the server-client boundary. Let me know if that's clear.
@MohammedIbrahim-fl2sx10 ай бұрын
i have a login page (Auth pages) how can i remove the components in RootLayout in those pages
@hamedbahram10 ай бұрын
You can use route groups to create to different layout. Watch this → kzbin.info/www/bejne/faCXo39nasyMitU
@maskman4821 Жыл бұрын
Great tutorial ❤
@hamedbahram Жыл бұрын
Thanks! Glad you found it helpful.
@mahmoudmohamed-xu2lb Жыл бұрын
so , we should use template to add exit route animations i tried it but it dosen't work what key should i pass to AnimatePresence and Thanks hamed for your amazing content
@hamedbahram Жыл бұрын
Yeah that should work, you can use any unique random key or the current path as the key.
@RicardoBarbosaSousa Жыл бұрын
Could you u use dark theme in the browser as well? 😊
@hamedbahram Жыл бұрын
I'll try it next time 🙂
@samislam2746 Жыл бұрын
So what's the purpose of having a layout with a "use client"? Anytime someone wants to use "use client' he can right away use a template instead. And also, why would someone use template without 'use client"? Any case will always use "use client".? I'm a bit confused.
@hamedbahram Жыл бұрын
Typically your layout is a server component that gets rendered once and remains the same when user navigates. The template on the hand will re-render every time because it uses a `key` prop. The template doesn't need to be a client component necessarily. I turned it into a client component in this example because I was using framer motion, but you don't need to.
@samislam2746 Жыл бұрын
The mouse pointer in the video is not visible
@hamedbahram Жыл бұрын
Yeah when I switch screens the mouse hides. I'll have to remember to click on tabs before pointing at different things on the page. Thanks for the feedback.
@tuRistst Жыл бұрын
But if I want to hide the header for about page?
@hamedbahram Жыл бұрын
Then don't put it in that route group.
@tuRistst Жыл бұрын
Thanks, but I found a solution using Route Groups
@AllahomAnsorGaza10 ай бұрын
how to pass data we fetched in layout to children pages
@hamedbahram10 ай бұрын
Not a straight forward way to do that, but you don't need to pass props, just re-fetch your data on the page as well, and React will de-duplicate the request.
@AllahomAnsorGaza10 ай бұрын
you are great teacher ☺️ thanks for all of your efforts
@hamedbahram10 ай бұрын
@@AllahomAnsorGaza Thank you! I appreciate that.
@CHIRANJIBNANDY19 ай бұрын
beautifully explained
@hamedbahram9 ай бұрын
Thank you! 🙂
@moazamdev Жыл бұрын
Does the template force the component to re-render?
@hamedbahram Жыл бұрын
Yes exactly.
@yuensc1964 ай бұрын
clear explanation
@hamedbahram4 ай бұрын
Glad to hear that!
@arihantjain3274 Жыл бұрын
This is Gold
@hamedbahram Жыл бұрын
Thanks 🫡
@raymondmichael4987 Жыл бұрын
Thanks buddy 😊
@hamedbahram Жыл бұрын
Any time!
@SanderCokart Жыл бұрын
I hope fixing exit animations on Templates is high on their roadmap, forced to use pages router for page animations
@hamedbahram Жыл бұрын
Hmm 🤔 didn't know there is a problem with exit navigation! I'll give it a try. Thanks for sharing.
@SanderCokart Жыл бұрын
@@hamedbahram templates document the use of exit animations but framer motions Animate Presence doesn't work with this because page is not the direct ancestor of the template
@hamedbahram Жыл бұрын
@@SanderCokart That's right. I just tested this, and while the exit navigation doesn't run, you can still animate the page. I changed the `main` tag that wraps the page in my template to `motion.main`
@SanderCokart Жыл бұрын
@@hamedbahram yes only initial and animate. Pages router is required till then.
@2gbeh Жыл бұрын
🇳🇬 Great job
@hamedbahram Жыл бұрын
Thanks!
@hamidhamri53842 ай бұрын
the template is not rerendering, it is remounting completely again
@hamedbahram2 ай бұрын
That's what re-rendering means.
@hamidhamri53842 ай бұрын
@@hamedbahram no, rerender and remount are two different things, they dont have same meaning and they dont do the same thing, remounting it means we remove the component from the browser dom then we mount it back and render (meaning runs component function), it is expensive, rerendering it means rerunning the component function again and rerun all the code inside that function, but the returned components from that components are not removed from the dom and remount back , so it is not expensive compared to remount
@shahryartavakkoli Жыл бұрын
Thanks
@hamedbahram Жыл бұрын
Anytime!
@toone4068 Жыл бұрын
thank you
@hamedbahram Жыл бұрын
You're welcome
@namesare4fools Жыл бұрын
your tutorial is excellent but i think content like this can be shorten to at most 10 mins
@hamedbahram Жыл бұрын
Thanks for your suggestion.
@sharpesthawk Жыл бұрын
You are *"Jeff Goldblum"* right? Am I the only one who thinks that?