1st time I watched it I got 80%, the 2nd time 95%. Now I just need to code myself to get it 100%. The best explanation of all UA-cam. Thank you so much.
I am react developer and never used typescript, just out of curiosity started watching it. Now i am suddenly feeling like i know complete Typescript. I mean how well you explained it, i can understand every second of this video. This is really some next level teaching skill.
@@patfre auch! was a funny way to say the content is great and well explained but still generics are hard and verbose no matter what. Will be healthy a pole to show how many devs use generics in his job. Also if an employer doesn't select you because you don't use a specific content, well, that is not the place.
@@jotasenator the whole point of generics is the make thing generic, they are very helpful in making things type safe especially with how much TS allows you to do, I just used it today to make my code simpler and cleaner and not be 100 lines of repeated code. Also the thing about companies is they want safe and reliable code that follows best practices a lot so they can absolutely deny you for something like this if your 100% not willing to follow their practices with the code
@@PlerbyMcFlerb the thing is I do use typescript, but never generics, in react.js and vue.js and next.js. I was watching this video because all the contents in here are explained in a way I like, still, don t see generics in the feature for me. Not saying I am against them, just I didn't find myself in a position saying: well, is time for generics...
As someone who has been anxious even when seeing cryptic type notations, this lesson is almost like a therapy session. For me, adding just after writing the function name make sense than coming back to it after annotating arguments. It reads like "this function / class is meant to work with these types".. Thank you!
I wish I could like this video a 100 times. You are the best teacher ever who sticks to the point and every second is worth watching and learning. Great job!
Wow this video shed a ton of light on some of the confusing pieces around generics for me. The content was so well put together and with the real life example with usages in react itself it really drove the point home from your early examples of generic benefits and when ti use them. Amazing way to teach these concepts. Thanks! Subscribed.
thanks for the clarity. you are great at explaining concepts, your vids have objectively made me better at TS and feels great when i manage to remember parts of vids when i encounter scenarios on my projects
This is the best video on generics I have watched so far. Was really struggling with understanding generics but this helped a lot. Explaining in terms of relationship between arguments and return type was brilliant
I honestly had such a hard time understanding generics and how they differed from explicitly declaring your types. Your emphasis on generics defining *relationships* finally made everything click for me. Thank you for explaining with all the examples!!
Why is the type parameter ( "") after the function name or type name necessary? I'm guessing it's just for better performance of the TS compiler. It seems the input parameter type(s) (including the sequence in which they appear) and the output type are sufficient information to determine the relationships that need to be codified. I'm grateful for your video. The statement that "generics are specifications of codifying relationships between parameter and output types" is excellent and did make it easy to understand generics.
you mentioned not to have "any" in your first example you returned => return [input.toUpperCase()] and said if you have an any this is no good since a number cant use the toUpperCase, wouldnt a generic do identically the same thing? const someFunc = (input:T):T[] => return[input.toUpperCase()] is this not the same as any?
Great! Just one question: what's the point of having a generic since you are extending it from something else (React.ReactNode in your example)? You do that just for relationships between params and return value or am I missing something? Thank you, keep it up!
How do I use generics in some generic component like Table, when I need the id property, for filter let's say... in that case Typescript complains that can't find the id on T type, so I must add intersect with & { id: string }, so I can help Typescript to infer the id type.
What is the point of using type generics with extends? (the last example) Aren't we adding unnecessary code by using the ? Couldn't we just use the "Theme" type everywhere instead of using the extended type generic?
Hello my friend, I am following you and I want advice from you. I am a front-end developer and I use next js and I have worked on actual projects and I want to start in the back-end field. You advise me to start with C# or Javascript framework and work. I am very confused. Please help me. From your point of view, what is best?
Hi brother, I am really worried about the rumor that some people are talking about server action. They say that servers may not be stable, and we shouldn't use them for our real projects. They consider them experimental and think they might be fully eliminated. What are your thoughts on this?
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.
1st time I watched it I got 80%, the 2nd time 95%. Now I just need to code myself to get it 100%. The best explanation of all UA-cam. Thank you so much.
I am react developer and never used typescript, just out of curiosity started watching it. Now i am suddenly feeling like i know complete Typescript.
I mean how well you explained it, i can understand every second of this video. This is really some next level teaching skill.
Honestly - this is probably the best description / example I've seen yet! Keep it up!
Thanks, will do!
agree 100%
I've also to *SUPER AGREE* - it's like *finally* someone really explained how it works - instead of talking plain code! 😻 haha 😹💦
I was avoiding generics for a while for no reason, now, finally I will avoid it with a reason
And now employers are gonna avoid you for a reason
@@patfre auch! was a funny way to say the content is great and well explained but still generics are hard and verbose no matter what. Will be healthy a pole to show how many devs use generics in his job. Also if an employer doesn't select you because you don't use a specific content, well, that is not the place.
@@jotasenator the whole point of generics is the make thing generic, they are very helpful in making things type safe especially with how much TS allows you to do, I just used it today to make my code simpler and cleaner and not be 100 lines of repeated code. Also the thing about companies is they want safe and reliable code that follows best practices a lot so they can absolutely deny you for something like this if your 100% not willing to follow their practices with the code
@@jotasenatormight as well just avoid typescript while you're at it. Generics are what allow effective code reuse and sound typing to coexist
@@PlerbyMcFlerb the thing is I do use typescript, but never generics, in react.js and vue.js and next.js. I was watching this video because all the contents in here are explained in a way I like, still, don t see generics in the feature for me. Not saying I am against them, just I didn't find myself in a position saying: well, is time for generics...
As someone who has been anxious even when seeing cryptic type notations, this lesson is almost like a therapy session. For me, adding just after writing the function name make sense than coming back to it after annotating arguments. It reads like "this function / class is meant to work with these types".. Thank you!
I wish I could like this video a 100 times. You are the best teacher ever who sticks to the point and every second is worth watching and learning. Great job!
Spectacular video, had it open in a side tab for a month and I can't regret more not watching it before. Clearest explanation I've seen in a while
Wow this video shed a ton of light on some of the confusing pieces around generics for me. The content was so well put together and with the real life example with usages in react itself it really drove the point home from your early examples of generic benefits and when ti use them. Amazing way to teach these concepts. Thanks! Subscribed.
thanks for the clarity. you are great at explaining concepts, your vids have objectively made me better at TS and feels great when i manage to remember parts of vids when i encounter scenarios on my projects
I agree, this is the best explanation of generics I've encountered. Makes them seem easy, so your video description is on point!
I never realised generics are that simple to explain. Simply great! 👍🏽
I really like the emphasis on the relationship aspect, great video!
Your lessons are great and easy to understand for me, thnx , keep going, 👍👍✅🚀
This is the best video on generics I have watched so far. Was really struggling with understanding generics but this helped a lot. Explaining in terms of relationship between arguments and return type was brilliant
I think the same too , best video for generics , again thank you so much @ByteGrag for these awesome videos
Great to hear!
I honestly had such a hard time understanding generics and how they differed from explicitly declaring your types. Your emphasis on generics defining *relationships* finally made everything click for me. Thank you for explaining with all the examples!!
it was the best of the best explanation i have seen. did not understand the generics, but now it all making sense. HUGE THANKS BRO
your channel is great for junior devs who already know javascript and got job but they need more tricks and knowledge to become a better developer
This is hands down the best explanation I've ever seen on type Generics. Thank you soo much!
Thanks for the best tutorial on generics I've ever found 🤗
"Hopefully this helps you out a little bit with generics". No sir! This helped me out a ton!
Excellent example, and i want to know what is this VS extension that is giving suggestions for auto code complete
You totally nailed it! I've read docs couple times and yet still didn't get full understanding, but now... thank you man!
Great to hear! :)
@@ByteGrad great explanation, keep up the good work
Your videos are REALLY helpful, thank you so much. Thanks for the best tutorial on generics I've ever found .
I was avoiding generics for a while for no reason, now, finally I will avoid it with a reason
Why is the type parameter ( "") after the function name or type name necessary? I'm guessing it's just for better performance of the TS compiler.
It seems the input parameter type(s) (including the sequence in which they appear) and the output type are sufficient information to determine the relationships that need to be codified.
I'm grateful for your video. The statement that "generics are specifications of codifying relationships between parameter and output types" is excellent and did make it easy to understand generics.
the way you explain is so clean and concise
Well done. It is one of the best explanations of generics I have heard. From super simple to using it in React. Really good. Got my sub!
This is the best video I've seen about generics.
easier than I thought now after watching your video, thank you very much!
The relationship tip was all I need to understand the generics! thanks mn
Damn, it feels difficult but you can no where find these kind of basic knowledge which you'll only get from experience.
Thanks allot.
I really liked the way you explain such a complex topic like this one, you got a new subscriber. Thanks!
Can't we use PropsWithChildren for props? 11:54
Thank you mate!
The video was on point. Finally I got a understanding in generics.
Amazing! I was confused before watching this. Great explanation!!
you mentioned not to have "any" in your first example you returned => return [input.toUpperCase()] and said if you have an any this is no good since a number cant use the toUpperCase, wouldnt a generic do identically the same thing? const someFunc = (input:T):T[] => return[input.toUpperCase()] is this not the same as any?
This is the best Ts generics video I've seen so far. Please, make video about mapped types and keyof keyword also. 👑
Is there a way to create extension methods on a Type without running into issues because you extended the .prototype?
If the React/Next.js course were explained like this, it would be amazing.
It was a very nice video thank you.
What package do u use to get suggestions for your code
Neat explanation of Typescript Generics. Thank you for your time, have good health and a nice day.
Wow! Finally...The relationship tip was the key to understand generics for me.
Great! Just one question: what's the point of having a generic since you are extending it from something else (React.ReactNode in your example)? You do that just for relationships between params and return value or am I missing something? Thank you, keep it up!
Yep, just to codify that relationship between the 2 props
I don't even use TypeScript, but after this video I actually understand how to use generics.
Excellent tutorial packed with valuable information and reasoning.
Thank you, Can I ask what extension you are using that it suggests when you code?
How do I use generics in some generic component like Table, when I need the id property, for filter let's say... in that case Typescript complains that can't find the id on T type, so I must add intersect with & { id: string }, so I can help Typescript to infer the id type.
. i had many confusion about ts Generics . this tutorial is very helpful for me thank you so much , , now i have clear understand
You can make it more clear when you leave out the { } and make the convertToArray as a one-liner.
const convertToArray = (input: T) => [input];
Just remember that it won't get hoisted.
Hello, when will your next js course be ready?
Finishing the last few details. Make sure you’re on the email list :)
This was such a good explanation. I was always wary of generics, but no longer!
Very clean and comprehensive tutorial, keep up the good work 🙌
In practice defining theme just as a string makes more sense, but I got your point, good tutorial
best explanation on generics so far
What is the point of using type generics with extends? (the last example) Aren't we adding unnecessary code by using the ? Couldn't we just use the "Theme" type everywhere instead of using the extended type generic?
It should be which means it can be any type, but at least a ReactNode. The point is to restrict the type
Thanks For your explanation about Generic, Wesley!!!! Great tutorial!
really enjoy the typescript/react content thank you!
Thanks Wesley! Great as always!
Amazing video dude! really helpful!
Awesome tutorial!! Super easy to follow! Thanks a mill!
Thanks for all your hard work, extremely helpful teacher!
Kind of clear explanation, bravo 👏
Awesome video you make this concepts really easy to understand ❤
Amamzing explanation !!!! loved it !!!!
Glad you liked it!
Wow, very clear and to the point
But why didn't we define type directly instead of extending generic type???? 18:38
You explain hard topics very clearly. Keep going like that ❤
sorry but can someone tell me in brief when or in which cases should i use generics ?
Very cool video! I found your channel today and subbed for more content
Hello my friend, I am following you and I want advice from you. I am a front-end developer and I use next js and I have worked on actual projects and I want to start in the back-end field. You advise me to start with C# or Javascript framework and work. I am very confused. Please help me. From your point of view, what is best?
Great video!
loved your explanations 🔥
Your videos are REALLY helpful, thank you so much
Very well explained 🎉
Can you also do a video on websockets and best way to implement in micro front end application
Good example, thanks!
Pure gold, and thank you!
Generic is so cool. Nice video!
Thx you, really great explanation.
Best best ts teacher on youtube
In just 22 minutes, I've learned a lot
well done , keep going sir !
Again, another extremely precise video to me
Awesome video! Thanks!
what vscode theme do you use?
So much value here!
what theme you use?
great explanation. thanks a lot .
thank you so much
any updates on react course sir😊?
Will send an email to everyone soon :)
Great! Your video is very easy to understand
The best video about generics ❤ thanks
This video earned a subscription.
very easy and cool explanation
Well explained!
thank for sharing! It's new for me! 🌈
Excellent presentation
As a C# developer, this might be easier for me to understand up-front than pure JS devs :)
which ai do for you this suggestions?
Thank you for the video learned a lot
This helped alot!
Hi brother, I am really worried about the rumor that some people are talking about server action. They say that servers may not be stable, and we shouldn't use them for our real projects. They consider them experimental and think they might be fully eliminated. What are your thoughts on this?
I haven’t heard that rumor and don’t think it will happen at all. Server Actions will be a big part of future web development IMO
@@ByteGrad thank u brother
That's a fake rumor 😂
react server component has been out for over a year, server action built on top of that, so I doubt it's going away any time soon
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.