A note about replace vs push, the Link component takes a `replace` prop that you can set to true (default is false) if you want the replace behaviour. It also has a `scroll` prop that you should set to false (default is true) if you don't want to scroll to the top of the page each time you click on an option.
@ByteGrad8 ай бұрын
Yeah, good points
@kamehameha384 ай бұрын
Arigato
@samyakpiya9 ай бұрын
You are so good at teaching web dev. I love that you show how something can be done with just JS and then proceed to show how a framework like Next.js makes it much simpler! Also, I really appreciate that you cover the edge cases and best practices. I'm learning a lot from watching your videos!
@dimitrisborbotsialos10 ай бұрын
We’ve actually used this technique 4 years ago on a react application, worked great and still does. We’ve also made a search component to listen for changes on the url and update a context. Our app was complex and many components had to be updated so using a context was the way to go. It’s funny though that no matter what we do we always coming back to 00’s concepts. It’s like php back in the days.
@Diegps10 ай бұрын
it's php with a mint flavor and I'm here for it
@spicynoodle741910 ай бұрын
Modern PHP with HTMX is the dream and I'm living it
@billypentester10 ай бұрын
It depends on the requirements. If you're developing apps that don't share data like admin panels, use states and react. But if you're developing sites that do share data like e-commerce websites, use params and next js.
@developerpranav10 ай бұрын
This is awesome with server components! Very detailed video that includes URL encoding and search params. Waiting for your nextjs course :D
@ByteGrad10 ай бұрын
Thanks! 😃
@saadelfadil6 ай бұрын
I stumbled upon your KZfaq channel just today and had to reach out immediately to express my gratitude for the incredible content you’re sharing. Even though it's only been a day, I've already spent hours soaking in your insights. The way you explain concepts is nothing short of amazing 🔥🔥
@webdev_telugu10 ай бұрын
Such a niche concept and he teaches us for free even though he has paid courses. Kudos my man!!
@ByteGrad10 ай бұрын
Thanks
@RealRatchet10 ай бұрын
It's not a niche concept putting stuff in query parameters was how Web1.0 did things because there was no client state, we've officially come full circle.
@shrin21010 ай бұрын
@@RealRatchetNow we write in components and not in pages. That's the only thing changed from Web 1.0
@webdev_telugu10 ай бұрын
@@RealRatchet yeah true, but I'm a new developer so new thing to me
@henriquematias198610 ай бұрын
What you mean niche concept? That’s how the internet works and always worked 😊 It’s just that some websites are broken so he’s teaching how to fix it 😅
@lets_see_7778 ай бұрын
somehow your teaching method resonates best with me. There are several popular youtubers on JS but you explain why we are doing things with alternatives. Thank you.
@coffeefps10 ай бұрын
This is actually clean and good. Just need to handle the magic strings gracefully and it's perfect. You earned my sub.
@maisamafshar10 ай бұрын
Excellent presentation and explanation. Loved the pace of the video, not slow, not fast. Subscribed.🤩
@LePhenixGD10 ай бұрын
Amazing tutorial man! Never had that idea to use URL parameters not for a search but for products until now, thank you!
@guilhermeferreirabr10 ай бұрын
Dziękuję bardzo za tutoriale, właśnie kupiłem dwa twoje kursy, niesamowita treść! 🚀👏🎬
@ByteGrad10 ай бұрын
Thanks Guilherme! Appreciate it
@ebratz9 ай бұрын
This tip saved me a lot of time today! Thank you so much! Eager waiting for your Next.js course!
@simoncunningham29642 ай бұрын
Thank you for this video - I've watched a lot of tutorials lately that go down the route of useState and useEffect but they never felt like the best way - glad I came across this video!
@foreverl0110 ай бұрын
I found your videos last week and I've seen more than 10 hours of your content. The way you explain things is amazing. Thanks, Wesley! I'm making an e-commerce myself to practice react and next.js, using app router. This solution to avoid using state and making components CC is great! I can't wait for the next js course!! 🥳
@ByteGrad10 ай бұрын
Awesome, thank you!
@saitharunreddya204610 ай бұрын
An awesome video with great details and explanation, loved it!!! Keep Up the good work
@seg_fault9 ай бұрын
Thanks for the video. I heard of this and needed to see an example of how to go about it and this went above and beyond with even the pitfalls to watch out for.
@jou38839 ай бұрын
I love you. You’re an awesome teacher. I’m grateful to have found your channel 🙏🏻
@vikasni9510 ай бұрын
Im very lucky to find your channel on random search.. Tq god for suggesting this gem channel... Tqss dude keep adding more videos 😍👍
@Olga-id1qy8 ай бұрын
Beautiful, it made me smile for a sec as I would write it exactly as you mentioned at the beginning via useEffect(). Now while transitioning to Next.js, I like definitely this one-way approach
@silentlyow10 ай бұрын
I recently started a project on a brand new framework recently (Next.js) with TypeScript as well (first typescript experience as well) and discovered this method of handling something like "state" in server components. Basically I had a product page and needed to do pagination and filtering, I did it using the query string.
@kevin-ty7it10 ай бұрын
I have a short attention span, but you shared information continuously, which kept me engaged throughout.
@ardianhotii10 ай бұрын
This video was very helpful, I'm learning so many new things from you that I didn't know that can cause problems in my apps. Thank you so much
@pi3ni09 ай бұрын
Thanks, very good content. A lot of real world cases, can't wait for your course! :)
@James-rd1sb10 ай бұрын
I never thought of it like this. I'm sure it'll be useful to know in the future! Many thanks
@veedjohnson10 ай бұрын
Definitely one of the best out there!
@mu_yaser10 ай бұрын
wanted to use this concept in my latest next project and you just explained things i needed to know, good info and explanation
@Anonymousssss36810 ай бұрын
The content was amazing. I used this approach in my project.
@user-ge2vc3rl1n10 ай бұрын
This is a very cool and unique example, looking forward to more. GJ
@Scrappycoco10 ай бұрын
Great content man. Keep it up!
@MOURADSLIM10 ай бұрын
I'm doing a search function and was gonna use a state manager to manage this problem, perfect timing XD Thank you
@ganumba1110 ай бұрын
amazing content from you like always 🔥🔥
@arinium5 ай бұрын
You make absolutely great tutorials, thank you for sharing!
@i.j.551310 ай бұрын
Very nicely explained and demonstrated 👍
@OpenCoreX10 ай бұрын
This is just amazing. Glad I discovered you - amazing teacher. #subscribed
@igboanugwocollins445210 ай бұрын
Neat approach, you just gained another sub
@codewithguillaume10 ай бұрын
Huge fan of this approach :)
@NOTHING-en2ue10 ай бұрын
very well tutorial, you finally teach me how to think the next-js way ❤
@filipniklas10 ай бұрын
Great video! Super helpful and well presented!
@weebdeveloper10 ай бұрын
True, derived state makes some features so much simpler to build, thanks for sharing
@mohammedelmoutaouakkil9 ай бұрын
Great tutorial! you got a subscriber
@WojciechBlachut10 ай бұрын
That is an excellent video! Thanks so much.
@rubelhossain851710 ай бұрын
amazing content ! Keep up the good work sir
@ByteGrad10 ай бұрын
Thanks, will do!
@billypentester10 ай бұрын
It's really something great for me, actually, I'm looking for something similar to this concept and I got it. So much thanks sir
@mmaarafat8 ай бұрын
thanks, mate. it was great explanation :)
@romeorel167910 ай бұрын
Never knew you have had a KZfaq channel. I discovered you from your CSS udemy course. Quality work.
@TitoMitto9 ай бұрын
Your tutorials are very informative
@oidualx9 ай бұрын
Thank you so much! This way of handling state is nothing knew, but I personally never put much thought into it until this video, and always defaulted to client state, with all the issues you listed. Typical aha moment. From now on you convinced me to always default to query params to handle state, unless there is a serious reason not to do so.
@nomadshiba10 ай бұрын
not using react or next, or tsx but this is so true! especially for modals, i like to keep my active modal info on the hash part of the url that way both page data and modal data can be placed on the url but of course you can use url params too i mean you realize that your site/app needs this the moment you refresh the page
@mohammadshariarparvez6699 ай бұрын
watching your first video , became a fan of you broooooooo.. god bless you
@loydcose278010 ай бұрын
Amazing, super helpful!
@user-qo6jf6jk2c10 ай бұрын
many thanks for great content ❤
@glauberbispo892210 ай бұрын
mind blowing I always work with states, i'm looking foward to implement this solution in some of my works *-* and it works really good together with server side in next
@aamiramin611210 ай бұрын
So informative. Thanks for sharing
@LearnFrontendNow10 ай бұрын
Always a super useful technique especially for UI's that you likely want to remember state when you copy and paste the link.
@shubhojeetbera10 ай бұрын
This was great & easy 👌🏻
@juanhedderich10 ай бұрын
That was awsome, ty man!!
@dero43310 ай бұрын
Dzięki za porady!
@ByteGrad10 ай бұрын
Bez problemu!
@darwin264210 ай бұрын
Thanks for this video, it helped me a lot.
@DiogoLScarmagnani8 ай бұрын
Wow! I didn't know about History API and its pushState method. Great! It can be used even in vanilla JavaScript projects. Thank you for the video.
@kumardeepam10 ай бұрын
This is so insightful and useful
@mohammadmo929010 ай бұрын
Amazing, thanks mate 👌👌
@giandenorte10 ай бұрын
Just subscribed, I love your content man! I wish the audio can be improve soon.
@ByteGrad10 ай бұрын
Yes, will improve soon. 2-3 more videos with this haha
@ByteGrad10 ай бұрын
My Professional React & Next.js course is OUT NOW now! Find it here: bytegrad.com/courses/professional-react-nextjs -- this is the #1 resource to master the latest React & Next.js, my absolute best work.
@brancode40410 ай бұрын
Can't wait for it. I hope it'll be out this Month? 😮
@ByteGrad10 ай бұрын
@@brancode404 Sending the exact date to email subscribers :)
@thevasupodcast456110 ай бұрын
Can you please also club react jobs that you find in your newsletter?
@youneshenni541710 ай бұрын
What application will you build in the upcoming next js course? Looking forward to it :)
@ByteGrad10 ай бұрын
@@youneshenni5417 I''ll show screenshots of them soon in the newsletter
@iBryanKops10 ай бұрын
Thanks for this content broth
@Wer-n3r10 ай бұрын
Dobra Robota
@raymondmichael498710 ай бұрын
I had similar use case today, pulled my hair for hours; Thanks brother 😊
@ammaralshathry918610 ай бұрын
really. incredible. keep up
@septiantonrezkirahmatulloh383710 ай бұрын
thank you, sir. from your knowledge. I am learned something new from this.
@ChrisHaupt6 ай бұрын
That's a really cool trick using the Link component to append a query param. Didn't know that was a thing!
@ota-ke10 ай бұрын
Pretty well explained. I didn't know server components get the searchParams as props by default!
@saputrauta099 ай бұрын
Thankyou so much!
@lorsothy626310 ай бұрын
Thank you so much. Now I found a way to select filters without use client.
@johncaballero546310 ай бұрын
Exactly what I need right now.
@jerryfrancis749510 ай бұрын
Am seriously anticipating your next js and react course. Great content as always
@ByteGrad10 ай бұрын
Great to hear Jerry!
@user-tq6kn5bv8hАй бұрын
a very intense video ,thank you very much teacher.
@UwU-dx5huАй бұрын
you are amazing at explaining ❤
@DerberAlter4 ай бұрын
thank you, this video helped me quite a lot
@ogbillity10 ай бұрын
I cant thank you enough for this tutorial.
@ThugLifeModafocah10 ай бұрын
Very good video. Thank you.
@thevasupodcast456110 ай бұрын
I love your videos. Thank you!
@ByteGrad10 ай бұрын
Glad you like them!
@HerrThomasE10 ай бұрын
thank you very much for this Great explanations,,!,,!!
@marchugans10 ай бұрын
Great approach
@ByteGrad10 ай бұрын
I agree, underused by many devs
@youssefaserrar200110 ай бұрын
You way of explaining is Awesome, I love you videos.
@ByteGrad10 ай бұрын
Thank you so much 😀
@mohamedbelaouer169610 ай бұрын
I juste love your content. thank you for your useful videos
@taicheeeee10 ай бұрын
Best youtubers for beginngers: Lama Dev, and Net Ninja Best youtuber for junior and middle developers: YOU
@ByteGrad10 ай бұрын
Haha thanks
@BK-qx3qf10 ай бұрын
You got subscriber. Nice tutorial.
@AndersonSousa3310 ай бұрын
Your videos are awesome! Just need to raise the audio volume a little bit.
@aymenbachiri-yh2hdАй бұрын
Thanks, very helpful informations
@MdNaimurRahmanHera10 ай бұрын
An awesome technique 😍😍
@Alex-bc3xe3 ай бұрын
freaking smart way of making the state in the URL never crossed my mind smart ass shit.
@lukas.webdev10 ай бұрын
Great video!! Thanks for sharing. 😉🔥
@ByteGrad10 ай бұрын
Thanks for watching!
@eedeenet10 ай бұрын
Just a note: I tried, lifting up my state to the url path. But in my specific case, it made the app very unresponsive. I do not know why. It was basically for a filter component. But after changing the filter (tried both params and searchParams) it would sometimes take seconds or even longer until the new state was shown in the app (both in url and component). Do you have any idea why this could be? I had eliminated all client components, it seemed to just be a lag in the client -> server communication? I was fetching data in a `page` which i would then filter by the route params and pass the filtered data down to a list component and the filter component to display the active state. Any tutorial on that (real world use case) with fetching data, I would be happy about.
@iamnguyenhoanganh5 ай бұрын
great video, thank you
@bklynpeter9 ай бұрын
Another amazing video. I do have a follow-up question: In your example, the page is a presumably dynamic route? How do we utilize those dynamic elements (again, in your example, 'product' and 't-shirt') at the same time we are accessing the query-params? Thanks as always!
@404-not-found-service4 ай бұрын
Thanks for the video, I liked it a lot, will you by any chance upload more material like this also using useOptimistic and so on? all the best
@alitonoliveira17009 ай бұрын
awesome!
@stephenngeorge10 ай бұрын
This is a really great video :) and super interesting. I know it's nothing to do with the video but the "JavaScript magic" to make the first letter uppercase on those buttons is just "text-transform: capitalize;" in CSS 👍
@redeemr8 ай бұрын
or since he's using tailwind just className="capitalize"
@chrishanthacosta40937 ай бұрын
I find Wesley to be the best NextJS teacher.
@ZacharyBetz10 ай бұрын
In case you weren’t aware, your content is top notch 👌