TypeScript in React - COMPLETE Tutorial (Crash Course)

Поделиться
HTML-код
  • Опубликовано: 9 июн 2024
  • 👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
    Hi, I'm Wesley. I'm a brand ambassador for Kinde (paid sponsorship).
    👉 Add auth to your app FAST: bit.ly/3QOe1Bh
    👉 NEW React & Next.js Course: bytegrad.com/courses/professi...
    👉 Professional JavaScript Course: bytegrad.com/courses/professi...
    👉 Professional CSS Course: bytegrad.com/courses/professi...
    👉 Discord: all my courses have a private Discord where I actively participate
    🔔 Email newsletter (BIG update soon): email.bytegrad.com
    ⏱️ Timestamps:
    0:00 JSX to TSX
    0:28 Typing variables
    1:28 Typing functions
    2:55 Typing React components
    3:17 React.FC
    3:52 Typing props
    6:37 Extracting type
    7:20 Benefits of TypeScript
    7:44 Optional
    8:14 Benefits of TypeScript (cont.)
    8:35 'any' type
    9:14 Type return value of component?
    9:38 Union type
    10:03 Extracting type
    10:45 Typing arrays
    11:32 Tuple type
    12:21 React.CSSProperties
    14:38 Record type
    16:01 Typing functions
    17:18 Typing children (React.ReactNode)
    18:34 React.JSX.Element vs React.ReactNode
    19:42 Typing useState setter function
    21:01 Default prop values
    21:35 Type Alias vs Interface
    24:00 ComponentPropsWithoutRef
    26:52 ...rest and ...spread
    27:49 Intersection (&)
    29:03 Interface extends
    29:34 Typing event handler functions
    31:13 Typing useState hook
    34:33 Typing useRef hook
    35:29 'as const'
    36:55 Omit utility
    37:38 'as' Type Assertion
    38:31 Generics (EASY!)
    42:00 Generics in React
    45:10 index.d.ts vs types.ts
    45:34 import type
    47:05 'unknown' type
    48:20 Zod
    48:58 ts-reset library
    49:28 Third-party types ('@types' / DefinitelyTyped)
    50:33 tsconfig.json
    52:09 next-env.d.ts
    #webdevelopment #programming #coding

Комментарии • 298

  • @abbasebadian6851
    @abbasebadian6851 3 дня назад +2

    The only person who explained "Why you need to put a comma after T". That's a +10000

  • @alan-oq4vk
    @alan-oq4vk 3 месяца назад +50

    Just discovered this guy. Amazing. Doesn't waste time. Doesn't try to be funny. No nonsense clear, solid info.

  • @XXXX-hr2lx
    @XXXX-hr2lx День назад +1

    This rapid fire and straightforward tutorial is exactly what I needed. I was trying to answer the question 'okay but how do I actually start using typescript?'

  • @endlessia
    @endlessia 9 месяцев назад +97

    So far the best «Everything you need to know » for Typescript with React ! ❤

    • @ByteGrad
      @ByteGrad  9 месяцев назад +13

      Glad you think so!

    • @ardianhotii
      @ardianhotii 9 месяцев назад +6

      I think the same too , the best video for typescript I've seen

    • @__mas
      @__mas 9 месяцев назад +1

      Insanely good.

    • @adamrodriguez7598
      @adamrodriguez7598 6 месяцев назад

      Seriously the best typescript video I needed

    • @wishmeheaven
      @wishmeheaven 5 месяцев назад

      I was actually looking the for useReducer, useMemo, and useCallback when I saw the title "COMPLETE"..

  • @VincentJenks
    @VincentJenks 8 месяцев назад +63

    Your videos are excellent - amongst the best. You move quickly, waste zero time, and get right down to brass tacks. No fluff, lame banter, etc. I wish all course authors were as sharp and succinct! Well done, I like your style.

    • @anastasiiazh.9107
      @anastasiiazh.9107 8 месяцев назад +2

      100% agree, love that it is straight to the point, and examples are great and very clear.

    • @jou3883
      @jou3883 7 месяцев назад +3

      Agreed. and my next compliment has nothing to do with the content - I genuinely think he's good looking. Not flirting though, just stating the truth about his appearance. He looks clean, tidy and healthy. If only majority of devs could take care of their health more. And his skin is flawless and glowing! Not sure if he used any filter when recording this vid, but nevertheless, tell me your secret @ByteGrad !😅

    • @khaleelalhaji
      @khaleelalhaji 7 месяцев назад

      ​@@jou3883😂

    • @wishmeheaven
      @wishmeheaven 5 месяцев назад

      Shouldn't the title "Complete" arrive with (at least) useReducer..?

    • @MarkEdwardTan
      @MarkEdwardTan 3 месяца назад +1

      I agree. Straight to the point. Excellent presentation and explanation as well.

  • @shadyheadstash
    @shadyheadstash 9 месяцев назад +30

    You're really nailing a great balance of introductory learning videos along with advanced topics. I find myself on your channel organically all the time and always find what need. Awesome work!

  • @sudarshan_savvy
    @sudarshan_savvy 7 месяцев назад +10

    You are the best tutor; you know how to teach concepts very well. I have taken many paid courses and learned from more than 50+ RUclips tutors, no one matches your teaching style. Perfect pace, not slow, not fast, just 100% perfect. Clear concepts with practical examples. Thanks.
    Your voice is relaxing but was bit low in this video.

  • @throwaway-lo4zw
    @throwaway-lo4zw 4 месяца назад +11

    ur voice, tone and pace makes ur tutorials way better to follow and understand than everyone else, am i the only 1 who thinks this ?

    • @srii_entertainment
      @srii_entertainment 4 месяца назад +1

      exactly. today I started watching a random video in this channel and I loved the way he speaks and immediately I subscribed to it and shared it to my friends.....

  • @armangohari6193
    @armangohari6193 2 месяца назад +1

    Whatever you teach goes straight to my mind's knowledge base, without me needing to organize the information. Thank you so much!

  • @kuldarkalvik0
    @kuldarkalvik0 9 месяцев назад +2

    Been quite sick for the past few days and this calm to-the-point teaching approach is just the perfect way to pass time productivly. Keep up the good work!

  • @sedmidivka
    @sedmidivka 6 месяцев назад +4

    what I like about your videos is that I feel like you know what you're talking about. I really don't like learning bad practices and many tutorials unfortunately teach those because nobody is perfect of course :D but I really like that it's doesn't sound like you are repeating something you've read yesterday but it is what you really know and understand and it isn't "just because" but it has a reason. thank you

  • @ahmedkhalid-ld1ex
    @ahmedkhalid-ld1ex 3 месяца назад +9

    it's sad that you can only like a video one time :(

  • @gurpritsingh3164
    @gurpritsingh3164 9 месяцев назад +2

    Came across your channel today and this is the second video I have watched. I must say this is gold standard. Thank you for the hard work you have put in.

  • @sagarchavada6226
    @sagarchavada6226 29 дней назад +1

    Love your super fast point to point teaching approach

  • @alirezagarshasbi6557
    @alirezagarshasbi6557 9 месяцев назад +1

    i appreciate the roadmap, where you started, continued and ended is just awesome, easy to learn and easy to remember.
    thanks alot.

  • @femmyemmy691
    @femmyemmy691 9 месяцев назад +4

    I had to learn all these the hard way on the job. I'm glad you are helping developers out with this stuff... Kudos!

  • @mangoherpson
    @mangoherpson 8 месяцев назад +2

    Love your method of teaching, straight to the point and concise. Subscribed.

  • @davesmith7658
    @davesmith7658 5 месяцев назад +1

    Great Tutorial, your slower pace and soothing voice made it easier to understand most of these concepts. Too many tutors who just talk to quick and assume the learners pace is at expert level. 🙌

  • @hell2force
    @hell2force 9 месяцев назад +1

    Really appreciate you sharing Typescript fundamentals in such an easy to follow way ! This will now serve as my typescript refresher.

  • @RajakumaranChakaravarthy
    @RajakumaranChakaravarthy 3 месяца назад +3

    By far best. Am going to suggest this video to every one in my team or ppl i know who are starting with Typescript. Thank you ❤

  • @rujinopy7746
    @rujinopy7746 6 месяцев назад +3

    I learn about TS in this video more than spending a whole year by myself lmao , really good content as always!

  • @arunkb6452
    @arunkb6452 Месяц назад

    Best explanation ever! 🔥 The best part is you just explained all the different scenarios with only one Button component. Need only this one video for typescript with React ! ❤

  • @julias3782
    @julias3782 8 месяцев назад +2

    Amazing quick explanations! I've watched the video in one breath. Thanks!!

  • @lokeshkumarsingh6120
    @lokeshkumarsingh6120 15 дней назад +2

    this was simply perfect! thanks a ton

  • @garnerhernani7114
    @garnerhernani7114 Месяц назад +1

    the best typescript tutorial I've seen so far!

  • @ts8960
    @ts8960 3 месяца назад +2

    I like that you are opinionated and use the cleanest looking formats , keep up the good work

  • @HenryBabbage
    @HenryBabbage 9 месяцев назад +1

    Epic video, it is rare to see so much info so clearly communicated. Totally enjoyable to watch and the perfect pace for getting started with Typescript. Thanks alot!

  • @quanghungpham269
    @quanghungpham269 5 месяцев назад +2

    Thanks a lot my friend, there are tons of tutorials out there but there are also people who have the basics of JS and React already. Your videos are suitable for people like me, learning fast and simple

  • @aliplaysgtr
    @aliplaysgtr 8 месяцев назад +2

    Super clear explanations of Generics, thanks a lot man!

  • @dickson710
    @dickson710 9 месяцев назад +4

    no BS, this is clean and integral handbook for react-ts dev, keep it up!

    • @ByteGrad
      @ByteGrad  9 месяцев назад

      Appreciate it!

  • @arshsblenderdump6438
    @arshsblenderdump6438 Месяц назад +1

    Extremely well delivered content
    I’ve had a problem with overall quality of content regarding development on youtube where you are not exactly learning but your way of teaching is really good and instead of just following along and having something that works your video allowed me to lewrn and make something of my own

  • @nchatu
    @nchatu 8 месяцев назад +1

    Definitely the best explanation that can easily be digested I got for Typescript generics.

  • @brancode404
    @brancode404 4 месяца назад +2

    Best Typescript course so far. I've learned alot thanks a ton brother. :)

  • @kashmirtechtv2948
    @kashmirtechtv2948 9 дней назад

    thanks man ❤❤ I have watched it completely and it's 100% recommended.

  • @zaxpeedy2852
    @zaxpeedy2852 3 месяца назад +1

    oh my god, thank you. this video is awesome, an hour of pure gold.

  • @daria_vyshniakova
    @daria_vyshniakova 3 месяца назад +1

    Wesley, thank you. This tutorial is amazing! I understand more from this video than from udemy TS course

  • @supafast1314
    @supafast1314 6 месяцев назад +1

    Crazy amount of value in this mini course, Thanks a lot 🙏

  • @andreas7027
    @andreas7027 Месяц назад +1

    So much knowledge compressed, thank you!

  • @gosnooky
    @gosnooky 9 месяцев назад +1

    Nice thing about tuples, you can unionize them for different lengths. If you accept 4 numbers for padding for [top, right, bottom, left] or 2 values for just top and bottom ([x, y]), say, you could annotate tuple elements: padding: [x: number, y: number] | [left: number, right: number, bottom: number, left: number], then compute your padding based on the array length.

  • @treyrader
    @treyrader 7 месяцев назад +1

    I've watched thousands of youtube channels and bro i love yours the best! Not sure if it's beginner friendly per se but for me it helps validate my understanding. ensures me that i am not entirely thinking about things wrong.

  • @AlexBereza
    @AlexBereza 9 месяцев назад +1

    This is just awesome! You've managed to explain most of the Typescript in React in just 1-hout video!

  • @sukhjindersingh7802
    @sukhjindersingh7802 9 месяцев назад +2

    Great in details and very easy to understand, Thanks a lot man ❤

  • @maxstrootmann
    @maxstrootmann 5 месяцев назад +1

    This is awesome! Thanks so much for the video and especially the timestamps.

  • @josantana6259
    @josantana6259 8 месяцев назад +2

    Wish I have found this video earlier. Simply the best.

  • @jsinnerx
    @jsinnerx 9 месяцев назад +3

    The best react with typescript video I've ever seen.

    • @wishmeheaven
      @wishmeheaven 5 месяцев назад

      Have you find those which called themselves "COMPLETE" as this one,
      But also include useReducer, useCallback and useMemo..? 👀

  • @pooyadehghan17
    @pooyadehghan17 2 месяца назад +1

    this is so complete ! thank you

  • @safariambience4052
    @safariambience4052 9 месяцев назад +12

    This is top-shelf educational content. Simple and easy to reference I have learned a lot. Thank you

    • @ByteGrad
      @ByteGrad  9 месяцев назад

      Great to hear, thanks

  • @siratmohaiminulislam8677
    @siratmohaiminulislam8677 10 дней назад +1

    I'm gonna get your courses right away. so straightforward. and you accent is so crisp and clear that it's hard not to fall in love with.. haha! and I am watching this after 8 months!

    • @ByteGrad
      @ByteGrad  10 дней назад

      Awesome, enjoy!

  • @ByteGrad
    @ByteGrad  9 месяцев назад +15

    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.

    • @foo3234
      @foo3234 9 месяцев назад +1

      your videos flow like water, very soothing, no fluff, straight to the most important details

    • @klaudiuszbiegacz3519
      @klaudiuszbiegacz3519 9 месяцев назад +1

      Is this course for someone who is not a beginner and more like a strong junior?

    • @ByteGrad
      @ByteGrad  7 месяцев назад

      @@klaudiuszbiegacz3519 Absolutely!

  • @yananderson5864
    @yananderson5864 7 месяцев назад +1

    Thank you so much for this video. I recently started a job, and it requires typescript, and this helped me a lot, it's incredible

  • @santoshparker8681
    @santoshparker8681 5 месяцев назад +1

    Awesome tutorial . Your channel deserves more subscribers. Just keep uploading videos. We are enjoying your content.

  • @male3399
    @male3399 9 месяцев назад +2

    That was very helpful I was looking for it to make things clearer!

  • @developerpranav
    @developerpranav 9 месяцев назад +4

    Such a thorough video. Thank you! This has so much that I didn't know before!

    • @ByteGrad
      @ByteGrad  9 месяцев назад +1

      Glad it was helpful!

  • @danielwang4518
    @danielwang4518 Месяц назад +1

    Thank you so much. This video is gold.

  • @minamulhaq
    @minamulhaq 9 месяцев назад +2

    You upload what I really need right now

  • @aboaya2012
    @aboaya2012 6 месяцев назад +1

    Very quick but very helpful for experienced backend developers whom looking for get into TypeScript quickly ... thanks a lot (Y)

  • @hurleywflow2227
    @hurleywflow2227 9 месяцев назад +1

    Concise and helpful. Love it.😊

  • @iqwebserve3973
    @iqwebserve3973 5 месяцев назад +1

    Fantastic refresher plus tricks.

  • @deni930918
    @deni930918 3 месяца назад +1

    Thank you for the valuable content in this video! I've been writing in TypeScript for quite a while, but I still learned a lot from watching it, and I recommend it to everyone.
    It would be great to make tutorials for creating a Next.js application from scratch. ❣👏

  • @dxabraham198
    @dxabraham198 9 месяцев назад +2

    I would of loved to watch this video 4 years ago when i was looking for a new job and i applied for one in which typescript was a nice-to-have requirement and when i joined the project it turned to be a whole react/node project written in TS. Everything you explain along the video i learned it struggling and pulling my hairs off of my head lol. Now i watched your video out of curiosity and i can say it's the best "Everything you need to know" video i've seen according to my experience. You really nailed it!

  • @Silverdagger258
    @Silverdagger258 9 месяцев назад +1

    Very informative video - clearly and concisely explaining all the major aspects someone needs in TS

  • @meew7571
    @meew7571 2 месяца назад +1

    great teaching bro. very helpful for as a react js developer trying to learn react typescript.

  • @enriquegrageda
    @enriquegrageda 5 месяцев назад +1

    My brother,
    All my questions, you have answered
    I know, you know your stuff
    Great Job! 😄

  • @gmjitendra
    @gmjitendra 2 месяца назад +1

    very lovely and described TS in react. Gr8 Thanks

  • @landrit.
    @landrit. 9 месяцев назад +1

    This is exactly what I was looking for!
    Thank you very much 👏🏻

  • @bashkort_erete
    @bashkort_erete Месяц назад +1

    God bless you, man, thank you for the lesson👍👍👍

  • @klaudiuszbiegacz3519
    @klaudiuszbiegacz3519 9 месяцев назад +3

    I'm really GRAD i've found your channel. So much useful knowledge and I really like the way you explain.

  • @OvercomerIdemudia
    @OvercomerIdemudia Месяц назад +1

    Just amazing! Thanks for sharing.

  • @faizanahmed9304
    @faizanahmed9304 9 месяцев назад +4

    Glad I found your channel.

  • @ryanwoods3333
    @ryanwoods3333 9 месяцев назад +5

    Thank you for this!
    I really hope you publish more React + TypeScript content as there isn't enough of it on RUclips which teaches both together.

    • @olusanyaolamide9764
      @olusanyaolamide9764 8 месяцев назад

      Exactly 💯, it's good to see videos like this, JavaScript mastery released a video recently saying React isn't NextJs and he talked about server components and how we must change the way we think when using the new nextJs 13 app router, the new changes can be a bit overwhelming especially for newbies just transitioning from react to nextJs, I still use the old pages directly for my learning for now, I feel the app router to be confusing

  • @rekikmarwa5216
    @rekikmarwa5216 7 месяцев назад +2

    Great typescript tutoriol, thank you so much

  • @naimurhasanrwd
    @naimurhasanrwd 9 месяцев назад +1

    This is best! You are extremely professional, experienced and also teach noob. Amzing.

  • @max_masterius
    @max_masterius 2 месяца назад +1

    That's great, thank you ❤ Finally I understand

  • @Raphael-jo1rp
    @Raphael-jo1rp 8 месяцев назад +1

    Very valuable. I start to think you are just at the top of the JS/Typescript/React game in RUclips.

  • @Yesterday_i_ate_rat
    @Yesterday_i_ate_rat 4 месяца назад

    Thank you so much for this amazing course❤

  • @olusanyaolamide9764
    @olusanyaolamide9764 9 месяцев назад +1

    The first time I saw your video, it was react mistakes junior developers make, I'm so intrigued by the quality of the presentation and the way you speak it's unique, it helps me easily understand, You are good!! real good!!

  • @ivanyoed
    @ivanyoed 4 месяца назад +1

    Thanks a lot man. Will be watching a lot of your videos. They're very well made. Sometimes a bit fast for me, but I can always pause or play them slower. Anyways, thanks for the hard work.

  • @Cypekeh
    @Cypekeh 9 месяцев назад +2

    These latest videos of yours are overpowered

  • @the_yugandharr
    @the_yugandharr 8 месяцев назад +2

    Amazing video!

  • @romaind4853
    @romaind4853 6 месяцев назад +1

    great tutorial, thank you !!

  • @shivagurung4161
    @shivagurung4161 6 месяцев назад +1

    Thank you ByteGrad!

  • @rifleking6189
    @rifleking6189 8 месяцев назад +1

    Thank you for an amazing tutorial

  • @saiphaneeshk.h.5482
    @saiphaneeshk.h.5482 9 месяцев назад +2

    Fabulous, just found the channel recently and helping me allot.
    Hopeing for more tips and tricks for reactTs.

  • @matthewbeardsley7004
    @matthewbeardsley7004 7 месяцев назад +3

    default exports or named exports?

  • @mohhamadtoosi8128
    @mohhamadtoosi8128 8 месяцев назад +1

    Thank you so much for this video.
    I learned a lot.

  • @hoyinleunghk
    @hoyinleunghk 6 месяцев назад +1

    thanks, I learn a lot!

  • @thanhninh2863
    @thanhninh2863 4 месяца назад

    Thank you for the informative and helpful tutorial

  • @peirama2
    @peirama2 5 месяцев назад +1

    great tutorial, thank you! i know that wrinkles are bad but you could allow yourself make some facial expressions from time to time :)

  • @ashrafsir69
    @ashrafsir69 9 месяцев назад +1

    Now that's what I call content! Awesome job!

  • @katerynamordovtseva1191
    @katerynamordovtseva1191 4 месяца назад +1

    Thank you for your job!)) I have never get such good quality info in Russian or any other languages!

  • @user-sq5ef1nr6r
    @user-sq5ef1nr6r 5 месяцев назад +1

    learn a lot from this vedio..Thank you sir❤

  • @shrishkerur7571
    @shrishkerur7571 9 месяцев назад +6

    Dude, your timing is perfect, and the way you teach is on another level. I never found anyone with Nextjs 13 and would be glad if you make one on Nextjs 13 with Redux

    • @mikerobin8410
      @mikerobin8410 9 месяцев назад

      Do you really need redux nowadays?. ContextAPI abstracts a lot

  • @alvinacosta2312
    @alvinacosta2312 8 месяцев назад +1

    finding myself liking every video i watch from you, so i can go back to them later for reference.

  • @olegsirbu2
    @olegsirbu2 6 месяцев назад +1

    thanks a lot! very nice video

  • @heysahilsingh
    @heysahilsingh 9 месяцев назад +2

    Amazing, such an amazing content you’re putting on internet.
    I wish you a lot of success, ❤️

  • @ej-d
    @ej-d 9 месяцев назад +1

    Very amazing content sir! straight to the point, clear and literally everything I need to know

    • @27sosite73
      @27sosite73 8 месяцев назад

      india, stop using "sir"
      this makes you look like you are brainless parrots repeating this "sir" word

  • @farzanekazemi7458
    @farzanekazemi7458 Месяц назад +1

    Thank you so much, this is a great tutorial and very helpful.
    What extension do you use for typescript?

  • @Coding-su3zj
    @Coding-su3zj 2 месяца назад +1

    U r the best. I love your style.

  • @saienrique
    @saienrique 9 месяцев назад +1

    Dude u r no less than a James bond. In looks and delivering content

  • @liquidohr84
    @liquidohr84 9 месяцев назад

    Not sure if it's intentional but your video has an ASMR effect. The most relaxing coding video I've seen.