How to build a Recursive React Component

  Рет қаралды 52,826

Sam Selikoff

Sam Selikoff

Күн бұрын

Пікірлер: 188
@srymisclick
@srymisclick 4 ай бұрын
To understand recursion, first you have to understand recursion.
@yeikiu
@yeikiu 4 ай бұрын
Agreed, but both come right after understanding recursion
@abnormal6376
@abnormal6376 3 ай бұрын
Very recursive.
@jasonennis4905
@jasonennis4905 3 ай бұрын
Pretty much 😅😂
@Ra5h3d_
@Ra5h3d_ 3 ай бұрын
I see what you did there 😅
@srinivaskoruprolu7638
@srinivaskoruprolu7638 3 ай бұрын
How to explain recursion without explaining it 😅
@nagasrinivasvinodkumarpand9309
@nagasrinivasvinodkumarpand9309 4 ай бұрын
I am totally blown.. became an instant fan of this guy.. Love the teaching.. simplicity.. elegance.. ticked all the things.. don't remember when I was so impressed with just one tutorial video.. hats-off!!
@no1_of_note
@no1_of_note 4 ай бұрын
Yes. The videos from this secret love child of Bradley Cooper and Hugh Jackman do indeed slap.
@akg530
@akg530 4 ай бұрын
I can’t stop staring at his face; too hot to handle AND he’s smart? we need more from him
@magnuserikkeenrobot1117
@magnuserikkeenrobot1117 4 ай бұрын
i agree, he is the best!
@GordonChil
@GordonChil 4 ай бұрын
*insert “Phrasing” Archer gif here*
@azkaarkhatib
@azkaarkhatib 4 ай бұрын
Loved how you made your way to the solution step by step by writing the duplicate code first and then separating that into its component, then fixing the data structure, then the types, then the naming. This not only shows me how to implement the topic but also how I should be thinking if I run into duplicate code.
@samselikoff
@samselikoff 4 ай бұрын
Glad to hear the approach landed! I always like to motivate every step because in the real world you should only use a new approach or tool if you have a specific pain point it addresses 👍
@club4796
@club4796 3 ай бұрын
-enjoying 100% and understanding 10%
@extremus7673
@extremus7673 4 ай бұрын
Crazy that I was building something similar at the moment, got somewhat stuck trying to think of a solution to do recursion, and this videos drops. Thank you so much!
@Szchmausser
@Szchmausser 2 ай бұрын
Wow! what a talent you have for explaining! I managed to make it work, and because I understood the whole process I was able to adapt it to my system, where I needed to show some data with a hierarchical structure. Thank you very much!
@privateaccount2607
@privateaccount2607 Ай бұрын
What an amazing video! This guy just made me the fan. The way he proceeds from scratch to the last was just incredible. Hats off to you.
@tomershechner
@tomershechner 2 ай бұрын
You're insanely talented, your teaching skills are top-notch.
@danieladionisio5165
@danieladionisio5165 3 ай бұрын
I loved how he explained this topic. Thanks for your approach! Now it seems more easy.
@mikeom1308
@mikeom1308 3 ай бұрын
Wow he has made this look so easy, while explaining it so clearly and concisely, was struggling with Typescript, now I think I understand it.
@MrBumbo90
@MrBumbo90 2 ай бұрын
Very good tutorial. I used recursion in a threejs react component a while back and this is a good use case for it. Thanks for the effort.
@parkerrex
@parkerrex 4 ай бұрын
Fantastic explanation. Also lots of little workflow tricks in here. I didn't realize there were 3 ways to use double cursors. Also never used emmet->remove tag!
@amanjha3346
@amanjha3346 3 ай бұрын
Just straight to the topic no intro no fancy drama..this is lit 🔥 awesome
@shoebuddin2533
@shoebuddin2533 3 ай бұрын
What an amazing explanation of data structure usage with react components. It is literally the best explanation I've seen since i started learning react👍👍💖
@WahiduzzamanHridoy
@WahiduzzamanHridoy 3 ай бұрын
I had done kind of the same thing a year ago for a project of mine. I really like the way you explained it. Thank you for sharing.
@laptopuser5198
@laptopuser5198 4 ай бұрын
This is one of the best channels for learning react.
@ratishjain2718
@ratishjain2718 4 ай бұрын
This guy deserves more subs man
@ganeshbabu8263
@ganeshbabu8263 4 ай бұрын
The Way you are using your editor is wonderful.
@ilirbajrami2902
@ilirbajrami2902 4 ай бұрын
Welcome back Sam! The world is safer when you are around :) Thanks for this one also! Very nice way to build a documentation page navigation.
@Rajdidnotdie
@Rajdidnotdie 3 ай бұрын
This is sooooo good , your style of explaining is very elegant.
@K.Huynh.
@K.Huynh. 3 ай бұрын
Thank you for sharing. This video helps me a lot.
@otaviomonteagudo6757
@otaviomonteagudo6757 3 ай бұрын
I was looking into building something like this, this video was great. You've earned yourself a lifetime subscription for buildio .
@samselikoff
@samselikoff 3 ай бұрын
I truly appreciate the support
@olawumisegun5898
@olawumisegun5898 4 ай бұрын
Thanks Sam for all you do for the community. I would love to propose a tutorial on Radix UI, hopefully a responsive landing page or more
@samselikoff
@samselikoff 4 ай бұрын
Thanks for the kind words! I made a Radix UI course earlier this year but it was more focused on microinteractions - can you give some more examples of which primitives from Radix you'd like to see more of?
@olawumisegun5898
@olawumisegun5898 4 ай бұрын
@@samselikoff Thanks alot for your response. Layout design showcasing the use of grid and flexbox would be fun to watch
@fernandocanizo8267
@fernandocanizo8267 4 ай бұрын
@@samselikoff I would like to know your opinion about the need for something like Shadcn/UI and alikes. Does it really provide value over plain Radix? Or anybody could just style Radix with ease? BTW, great video, pretty clear and to the point without missing anything.
@Serkan0kur
@Serkan0kur 4 ай бұрын
Great tutorial. It is not just presenting the final code, Sam demonstates how a programmer can move forward building and cleaning the code. Thank you Sam, for sharing the video. I will be waiting forward for more mindblowing contents.
@D_bugit
@D_bugit 3 ай бұрын
Just looking at this gives me an idea... Thanks ❤❤
@tritc
@tritc 3 ай бұрын
This tutorial video is amazing, and I am grateful for your help! Keep the good work bro!
@dev-akeel
@dev-akeel 4 ай бұрын
I can't stop myself: Really Really Amazing 👏
@zeeshan4341
@zeeshan4341 4 ай бұрын
I have seen this example before. But loved your video 😊
@jamesgulland
@jamesgulland 4 ай бұрын
Incredible video, simply explained. I’ve always heard about recursion but never had to apply it, this gave me the light bulb moment! Biggups.
@Rico-cp4xp
@Rico-cp4xp 4 ай бұрын
The drought is over! Love your videos. Never heard of this concept before!
@maddbzfan234
@maddbzfan234 4 ай бұрын
i never knew about the react recursive components before, but this video cleared most of my concepts, and it was so cool 🙌
@shanehoban
@shanehoban 4 ай бұрын
Great example of recursive components. The next task you might want to consider is to have recursive components that effect state, where the page/top level state is changed, and also the specific child component state is changed (effecting it's child component) - which will cause too many re-renders if not handled correctly. Not to give away the answer, but imagine a top level state that is an object, where the child components have a button that can add new levels to this state onto themselves. The state must be pushed upwards in this case, and passing keys won't work in a multi level nested object (in an onChange for example). The task therefore is to have the state reflected correctly without causing too many re-renders. Happy to walk through in more detail, might be nice for another video for you.
@samselikoff
@samselikoff 4 ай бұрын
Yeah that sounds like a fun one! In general I don't like to think about re-renders in React until they cause a problem (and I think others should do the same). There's plenty of examples where the approach here will work just fine for. Also I'm hopeful the React Compiler will make that sort of perf optimization unnecessary.
@rajat_kaushik
@rajat_kaushik 3 ай бұрын
This was so well delivered!
@alexandroarauco8097
@alexandroarauco8097 4 ай бұрын
Amazing tutorial, explanation is so clear. Thanks.
@yashsolanki069
@yashsolanki069 3 ай бұрын
Absolute 💎 and loved the react conf presentation as well !!!
@UdaySagar
@UdaySagar 3 ай бұрын
thats soo awesome ddude , i struggled to make one for one of my projects few days ago but not able to .. thanks .
@Bread-vk8fl
@Bread-vk8fl 3 ай бұрын
This is amazing!! wow, i'm impressed
@3Shivs
@3Shivs Ай бұрын
recently for drag & drop I handled it in unelegant way, am going replace this with recursion. Thank you so much man,
@adiMallya
@adiMallya 4 ай бұрын
Damn. You just made it look less overwhelming!
@wandenreich770
@wandenreich770 4 ай бұрын
Very informative..turns out I could have used recursion in my project
@aymenbachiri-yh2hd
@aymenbachiri-yh2hd 3 ай бұрын
Thank you so much sam, very helpful content, please keep posting videos
@fireball7456
@fireball7456 4 ай бұрын
I am so glad I stumbled upon this channel, that was so interesting to learn about! That was also so incredibly smooth and well edited. If you did this in one take, that's unbelievable.
@BeeBeeEight
@BeeBeeEight 3 ай бұрын
Very nice tutorial, I subbed immediately. Just like to point out that outside of react, recursion can also be used to calculate factorials, permutations, summation series, etc due to the repetitive nature of these calculations. It helps to understand recursion in a general sense so we know when to apply recursive patterns.
@shubhamdas6519
@shubhamdas6519 25 күн бұрын
Thanks for the video sir.
@alexg7282
@alexg7282 4 ай бұрын
Nice tutorial. This video's format is just perfect. Thanks a lot !
@LHQQ888
@LHQQ888 3 ай бұрын
Thanks Sam !
@magnuserikkeenrobot1117
@magnuserikkeenrobot1117 4 ай бұрын
absolutely amazing. i love your style and your videos always amaze me. keep it coming! i recommend creating some shorter videos which shows some tips and tricks
@nourigadjanibrahim
@nourigadjanibrahim 3 ай бұрын
Great!!! We are waiting for a sequel to this file management tutorial
@samselikoff
@samselikoff 3 ай бұрын
Thanks! What would you like to see?
@nourigadjanibrahim
@nourigadjanibrahim 3 ай бұрын
@@samselikoff Connection to a database. (CRUD) Automation of folder creation and file saving.
@samselikoff
@samselikoff 3 ай бұрын
@@nourigadjanibrahim Cool idea! Would you want to see the folder/file creation actually happen on the filesystem, or in a database with virtual files/folders?
@carefulcode
@carefulcode 3 ай бұрын
Beautiful stuff man. Thanks for this!
@technosujeet
@technosujeet 15 күн бұрын
Nice explanation
@alarsut
@alarsut 4 ай бұрын
thanks for your video sam! I am looking forward to your new course.
@limitlesskode
@limitlesskode 3 ай бұрын
This is genius. Subscribed
@MohamedElguarir
@MohamedElguarir 4 ай бұрын
maan, great to see you back on YT! Love your videos 🙏🙌
4 ай бұрын
Thanks for sharing. This is completely about the case which I was assigned.
@faruksardar8829
@faruksardar8829 4 ай бұрын
Finally Sam is back 💖💖
@sanjaytomar135
@sanjaytomar135 3 ай бұрын
it was great, thank you, and do make more videos like this
@kaushalkumar6666
@kaushalkumar6666 4 ай бұрын
Awesome stuff explaining style is preety great and clear
@jitxhere
@jitxhere 4 ай бұрын
It was almost magical as you progressed. Really like your teaching style. Wow I am amazed
@edgarasben
@edgarasben 4 ай бұрын
Thanks Sam! Love learning small powerful nuggets like this:)
@collinsk8754
@collinsk8754 3 ай бұрын
Great stuff! Very clear!
@osamammursleen
@osamammursleen 4 ай бұрын
Thanks. Its super fun to learn.
@MrAlao675
@MrAlao675 4 ай бұрын
This is very clean and too awesome ❤❤❤
@dgiri2333
@dgiri2333 4 ай бұрын
Nice it's help change browser UI Build Idea changes soon
@akshatdubey4421
@akshatdubey4421 4 ай бұрын
Great explanation!
@voinbobar
@voinbobar 4 ай бұрын
Simple yet very informative video! Love it.
@풍월상신
@풍월상신 4 ай бұрын
This is amazing!! Thank you Sam.
@CodeWithRomaen
@CodeWithRomaen 4 ай бұрын
missed your videos. absolutely love your videos. You are such a good educator
@IDOLIKIofficial
@IDOLIKIofficial 4 ай бұрын
Quality content, very clean stuff!
@mudgalz
@mudgalz 3 ай бұрын
You've got new subscriber
@karsongrady
@karsongrady 4 ай бұрын
Sheesh, that is a beautiful implementation! Thanks, Sam!
@regilearn2138
@regilearn2138 4 ай бұрын
It went like breeze, appreciate it we need react with SOLID principle please
@nick-ui
@nick-ui 4 ай бұрын
Lessgooo, Sam's comeback!
@leulfanuel3550
@leulfanuel3550 4 ай бұрын
Great video, please keep em coming. We are learning a lot 🎉
@thanyaniinnocent940
@thanyaniinnocent940 3 ай бұрын
Him: How cool is this This is so cool 💥💥🔥🔥
@akshaysingh5933
@akshaysingh5933 4 ай бұрын
Thank you for sharing! The feature is great. Could you also consider adding drag-and-drop functionality for folders and files? That would be fantastic!
@roid1510
@roid1510 4 ай бұрын
damn i never thought rendering a Component in itself was possible. On the other hand why wouldnt it work? its just a function. :D learned a new thing today. Thank you!
@jackjsy
@jackjsy 4 ай бұрын
Built something like this a few times and you gota be careful on very deep tree's when using state, lots of re-rendering! hopefully react compiler will solve all of that soon!
@luizvictoriobaptistaneto1561
@luizvictoriobaptistaneto1561 4 ай бұрын
That was awesome!
@abhisflyingsoon
@abhisflyingsoon 4 ай бұрын
this is super helpful, thx :D need more pls
@HeyNoah
@HeyNoah 4 ай бұрын
Dude, this is so cool!
@lih4553
@lih4553 4 ай бұрын
Finally more vids 💪
@swrserwerwr9137
@swrserwerwr9137 Ай бұрын
you are genius
@acloudonthebluestsky9687
@acloudonthebluestsky9687 4 ай бұрын
You are the GOAT sir ,3
@flaviojunior4408
@flaviojunior4408 4 ай бұрын
Awesome tutorial man! One way the code could be improved is to make a component for a Folder and other for a File (kinda like a strategy). And since the collapsible state matters only for folders you could avoid creating unnecessary state for files
@samselikoff
@samselikoff 4 ай бұрын
Thanks! I actually think it's cleaner with one component - my general rule is to not extract until it's painful. I really appreciate how easy React makes it to incrementally add complexity & I fully embrace it in my work! If it started to get crazy you could definitely abstract but in my experience it's best to hold off abstracting as long as possible.
@igorgoncalves5691
@igorgoncalves5691 4 ай бұрын
Nice explanation, thnks
@maxwebstudio
@maxwebstudio 4 ай бұрын
Great video
@hab_tech
@hab_tech 4 ай бұрын
keep posting bro I like your vids
@sivabalanmurugavel6913
@sivabalanmurugavel6913 3 ай бұрын
Absolute 💎
@scotle9901
@scotle9901 4 ай бұрын
It's awesome. Thank bro.🎉
@IkraamDev
@IkraamDev 4 ай бұрын
Great video as always!
@yashone7
@yashone7 3 ай бұрын
Sweet jesus, I didn't know rendering trees was this simple, or was it made simpler by sam?? Lovely stuff
@andresgutgon
@andresgutgon 4 ай бұрын
Awesome video 🎉
@anshikgupta2993
@anshikgupta2993 2 ай бұрын
Can we add check boxes beside each node and add selection in parent children selection
@rachitshrivastava4583
@rachitshrivastava4583 3 ай бұрын
Hey Sam, loved this explanation and your way of teaching things step by step. I’ve been learning and using vim from past few months… may I know what shortcut did you use at 18:56 for renaming “Folder” to “Node” everywhere in the file? Also are you using VS code with vim enabled or the terminal with NVIM or something ?
@samselikoff
@samselikoff 3 ай бұрын
Thanks for the kind words! The rename is a VSCode feature, you can find it as "Rename symbol" in the command palette or with the F2 shortcut (which is how I do it). It renames things semantically so it understands scope and everything. Definitely one of my fave features and I use it all the time. I use VS Code with the vim extension: marketplace.visualstudio.com/items?itemName=vscodevim.vim
@redhat321
@redhat321 2 ай бұрын
very cool 👏
@shafu_xyz
@shafu_xyz 4 ай бұрын
so neat!
@jomarmontuya1314
@jomarmontuya1314 4 ай бұрын
Guess what, you got new follower
@ekekw930
@ekekw930 4 ай бұрын
How would you go about keeping the state of each open folder so on a page refresh the same ones stay open?
@Coder-Journey
@Coder-Journey 4 ай бұрын
Holysheet that’s cool ❤
@PitZza143
@PitZza143 4 ай бұрын
Awesome
Building an Elastic Slider with Framer Motion and Radix
52:07
Sam Selikoff
Рет қаралды 11 М.
Animate streaming text with a one-line hook
29:48
Sam Selikoff
Рет қаралды 9 М.
Thank you Santa
00:13
Nadir Show
Рет қаралды 33 МЛН
When u fight over the armrest
00:41
Adam W
Рет қаралды 32 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
How JavaScript Ruined the Web
15:02
Eric Murphy
Рет қаралды 118 М.
Definitive Guide to React Component Design and the key to avoiding tech debt
1:23:30
Kevin Ghadyani - JavaScript
Рет қаралды 19 М.
Magic UI Review: The Best of Radix, Shadcn & Framer Motion
9:54
techgirlinstyle
Рет қаралды 4,4 М.
Loading Your React Data Like This is Awesome
13:27
Josh tried coding
Рет қаралды 113 М.
How To Handle Permissions Like A Senior Dev
36:39
Web Dev Simplified
Рет қаралды 177 М.
Compound Components in React (Design Patterns)
18:21
Cosden Solutions
Рет қаралды 46 М.
This is how I recommend you learn Recursion in Javascript
24:39
Web Dev Cody
Рет қаралды 32 М.
Learn Git - The Full Course
4:20:00
Boot dev
Рет қаралды 59 М.
Avoid premature abstraction with Unstyled Components
17:23
Sam Selikoff
Рет қаралды 13 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
Thank you Santa
00:13
Nadir Show
Рет қаралды 33 МЛН