Тёмный

Next.js 14 Tutorial - 20 - Active Links 

Codevolution
Подписаться 669 тыс.
Просмотров 71 тыс.
50% 1

📘 Frontend Interview Course - learn.codevolu...
💖 Support UPI - support.codevo...
💖 Support Paypal - www.paypal.me/...
💾 Github - github.com/gop...
📱 Follow Codevolution
+ Twitter - / codevolutionweb
+ Facebook - / codevolutionweb
📫 Business - codevolution.business@gmail.com
Next.js 14
Next.js Tutorial
Next.js 14 Tutorial
Next.js Tutorial for Beginners
Active Links
Styling Active Links

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 50   
@gamingwolf3385
@gamingwolf3385 5 месяцев назад
Don't use "use client" in layout , all pages inside this layout will be client rendered , its better to create client component contain all your links ,then use pathname inside it ,and let the layout derver rendered
@ahmedmrsawy9215
@ahmedmrsawy9215 5 месяцев назад
using use client in layout is not recommended
@esr9749
@esr9749 3 месяца назад
Why it is not recommended?
@linuxon-s3f
@linuxon-s3f 7 месяцев назад
When we give href='/' to the home page, it automatically becomes an active link, how can we prevent this? const navLinks = [ { name: 'Home', href: '/' }, { name: 'About', href: '/about' }, { name: 'Contact', href: '/contact' }, ]
@IsraelWongMX
@IsraelWongMX 5 месяцев назад
I also have that doubt, were you able to solve it yet?
@BeardedSmellyFox
@BeardedSmellyFox 3 месяца назад
const isActive = pathname.startsWith(link.href) && pathname.length == link.href.length;
@killua8762
@killua8762 2 месяца назад
@@BeardedSmellyFox This won't work for nested links.
@C9Sid
@C9Sid 5 месяцев назад
03:10 If you guys will use startsWith and there will be a home page in your with path '/' Than it will set home and other page active at the same time. To avoide this use endsWith instead of startsWith.
@oladelejoseph2892
@oladelejoseph2892 5 месяцев назад
Thanks so much
@ken2ker495
@ken2ker495 4 месяца назад
thank you , i meet this problem but don't know how to solve it , thank you bro
@kimiafarshadnia
@kimiafarshadnia 3 месяца назад
That’s right 🎉
@LucasFarias-kk6kt
@LucasFarias-kk6kt 3 месяца назад
thank you man!
@animatedzombie64
@animatedzombie64 4 месяца назад
i learnt react around 2019 from this channel. now i'm a software architect, what a journey!!
@panjiprawiro1603
@panjiprawiro1603 3 месяца назад
hy can you explain more what is software architect do? are you still develop website using react in your job?
@ainmosni4319
@ainmosni4319 4 месяца назад
There is nothing wrong with using pathname === link.href instead of Isactive right?
@pratishjoshi
@pratishjoshi 6 месяцев назад
Props to this guy man. Seriously! So easy to understand! Keep up the good work mate! Subbed, Liked and about to recommend this great of a content to everybody looking to learn NextJS.
@ahmadullahnikzad2850
@ahmadullahnikzad2850 4 месяца назад
the startwith approach has some bug for example the home href starts with / and the other href starts with for example /login then at the same time the home link and the login link have the same style
@MrSandeeparneja
@MrSandeeparneja 8 месяцев назад
can you talk about how to get the benefits of server side components while still being able to mark the path being visited as active? if we mark the whole layout as "use client" it comes with its drawbacks as layout is a perfect page which can benefit from server side rendering and caching
@darkxhornet2440
@darkxhornet2440 3 месяца назад
the most underrated and absolutely godly NEXTJS course on YT ....
@NoumanShahbaz-p5z
@NoumanShahbaz-p5z Месяц назад
You said that all React Components are by default Server Components , but its wrong you have to say all Next Components are by default Server Component
@kalilinux8682
@kalilinux8682 7 месяцев назад
Wouldn't making layout.tsx client component degrade performance?
@kimiafarshadnia
@kimiafarshadnia 3 месяца назад
This solution not work for home , when we have '/' not work and home page always have active style
@jainishpatel8542
@jainishpatel8542 6 дней назад
My rootLayout is also showing here, what should i do for that?
@therodri595
@therodri595 10 месяцев назад
can you please make a video on how to handle responsive images without the height and width set to an specific size??? , i just hate how nextjs handles them , i prefer simple html and "object-fijt"
@marckentevalle7535
@marckentevalle7535 3 месяца назад
why does it say module not found can someone explain please?
@ねこ-p1b7o
@ねこ-p1b7o 5 месяцев назад
So in nextjs you need to check manually using pathname. In react router dom I think you don't have to check manually.
@SidsAnalysis
@SidsAnalysis 8 месяцев назад
I was not intended to subscribe any English channel because I love understand in hindi. But this English channel gives 1 deep understanding of concepts, 2 clear view of code because of good default zoom level for mobiles, 3 when I see it in 360p quality it shows clear, 4 also clear voice, 5 much available tutorials for node concepts with deep logic in this channel 6 to the point lessons, 7 covers each topic, 8 organized in playlist 9 so it makes focus on learning, I watched all playlist videos before it. 10 Now I like it 😁 So this qualities forced me to Subscribe this channel ❤❤😅😅
@neerajrajpal
@neerajrajpal 3 дня назад
import Link from "next/link"; const navLinks = [ { name: "Register", href: "/register" }, { name: "Login", href: "/login" }, { name: "Forgot Password", href: "/forgot-password" }, ]; export default function AuthLayout({ children, }: { children: React.ReactNode; }) { return ( {navLinks.map((link) => { return ( {link.name} ); })} {children} ); }
@bitslayerscorpion8776
@bitslayerscorpion8776 10 месяцев назад
When will this series complete ? How many videos have you planned ?
@theboyIncomfortzone
@theboyIncomfortzone 8 месяцев назад
I wanna know it too
@mghendipato
@mghendipato 6 месяцев назад
That means one should avoid using "/" for home route, since the "isActive" logic will always mark it as active
@AnoNymous-el6mr
@AnoNymous-el6mr 7 месяцев назад
hi, if you're working on an app with a multiple groupe pages such as dasboard section, an admin section and a public section, and so to get access to dashboard pages, you have to navigate to /dashboard, and so the links for the dashboard all starts /dashboard/.... then how would you do ?
@yanferaraque1051
@yanferaraque1051 8 месяцев назад
I had issues with my map method, didn't show the data even if it show there was something blank there, then I used the way you did it and worked!!, thank you a lot my friend, I hope one day I can post videos like you to help people from my lenguage.
@khalidmuzemil9020
@khalidmuzemil9020 22 дня назад
it didn't worked may be because you didn't use return before your sentence you have to return otherwise nothing will be shown
@franklinrodriguez5427
@franklinrodriguez5427 2 месяца назад
I know there are many people who have thanked you for the work you do on RU-vid but I also want to thank you for so many tutorials like this, they are very helpful to the community.
@divyarajsinhrana6045
@divyarajsinhrana6045 7 месяцев назад
It is not working for nested route like /about/me etc. paths
@neymarleonel-h7x
@neymarleonel-h7x 6 месяцев назад
thanks bro. your explication is another level .keep going like that bro
@JoshuaMusau
@JoshuaMusau 5 месяцев назад
This guy teaches so well. Give him his flowers, no diddy!
@Kelvin_Falah
@Kelvin_Falah 3 месяца назад
nice tutorial,its eazy and simple explanation
@makobakaweme2821
@makobakaweme2821 3 месяца назад
Thanks for the tuts. Always so helpful.
@codetechygoon
@codetechygoon 10 месяцев назад
The important thing with the usepathname is that, it doesn't detect/recognise the hash links.
@asfnobambu
@asfnobambu 10 месяцев назад
Your style of asking like/subscribe only in the end is very polite! I like it that very much... Thank you for your educatinal efforts.
@chesterxp508
@chesterxp508 3 месяца назад
GoodJob!
@yuriyula
@yuriyula 8 месяцев назад
thank you very much! I searched the whole Internet in search of a good solution and found it on your channel
@sujonpramanik1151
@sujonpramanik1151 10 месяцев назад
really is was nice sir
@HadiAriakia
@HadiAriakia 8 месяцев назад
Good job mate.
@faizanahmed9304
@faizanahmed9304 10 месяцев назад
Thanks!🎉
@riyad-appscode
@riyad-appscode 10 месяцев назад
Great Video 👍
@jsiqueiraest
@jsiqueiraest 10 месяцев назад
goat
@CKNMEDIA
@CKNMEDIA 10 месяцев назад
Great one
Далее
Ко мне подкатил бармен
00:58
Просмотров 165 тыс.
ОБЗОР НА ШТАНЫ от БЕЗДNA
00:59
Просмотров 380 тыс.
This Took Me 150 Hours to Code
16:40
Просмотров 195 тыс.
10 common mistakes with the Next.js App Router
20:37
Просмотров 216 тыс.
Next.js 15 Ruins Caching Even More
13:56
Просмотров 47 тыс.
Next.js 14 Tutorial - 19 - Link Component Navigation
7:24
NextJS Tutorial - All 12 Concepts You Need to Know
44:38