React Typescript Tutorial - Why and How (get started now!)

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

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

  • @muhammadjaffarrazadar967
    @muhammadjaffarrazadar967 4 года назад +4

    So far this is the best react + typescript tutorial I have found on youtube. make more buddy.

  • @kuroshzamani1775
    @kuroshzamani1775 4 года назад +6

    Hi , I just wanted to thank you for this tutorial. It's straight to the point, managed to be short, but still covers all the practical things you have to know to get started. Perfect intro.

    • @Classsed
      @Classsed  4 года назад

      Thanks a lot, I'm glad to hear that :D

  • @classics7470
    @classics7470 4 года назад +3

    Excellent react-typescript tutorials.... we need series of this kind of lecture!!

  • @Middollo
    @Middollo 5 лет назад +8

    Just what i was looking for, perfect intro to TypeScript. Thank you.

  • @robertotorres7414
    @robertotorres7414 4 года назад +1

    Awesome video dude, gonna write this up now to practice. Really useful stuff and excellent explanations. Keep it up, theme was cool btw!

  • @mr.ticket2paradise799
    @mr.ticket2paradise799 3 года назад

    This video is clearly underrated. Best Typescript React tutorial. Keep it up !!

  • @MarsTheProgrammer
    @MarsTheProgrammer 5 лет назад +2

    For mac and linux users please enter this in your terminal first (if you haven't installed typescript before):
    npm install -g typescript
    then do:
    npx create-react-app ts-react --typescript

  • @mirzahedali3044
    @mirzahedali3044 5 лет назад +1

    Just wanna say your coding techniques are "ON POINT"!

  • @ArielMagno2013
    @ArielMagno2013 4 года назад

    Very straightforward and easy to learn. Hope to learn more from your videos.

  • @valentinoyoutub
    @valentinoyoutub 4 года назад +2

    This was great thanks! It would be awesome if you could teach us build a full stack application with Node, React, GraphQL and TypeScript. This stack starts being very common out there and so far I could not find one good tutorial on it! Fingers crossed you'll read this :)

    • @Classsed
      @Classsed  4 года назад +1

      I will soon do PERN stack tutorial with TypeScript so look forward to that! and I read all comments ;)

  • @AmanNidhi
    @AmanNidhi 5 лет назад +2

    please make a playlist for ts+react+styling to show how to make basic app and teach us use interfaces effectively

  • @sheryarshirazi2799
    @sheryarshirazi2799 5 лет назад +4

    really need a series over react typescript. appreciated.

  • @Ishwarchauhan17
    @Ishwarchauhan17 5 лет назад +2

    Thank you for spreading the knowledge.

  • @lewis6590
    @lewis6590 5 лет назад

    Practical and to the point. Thank you for not wasting too much time on exposition.

  • @TheYellowyeyes
    @TheYellowyeyes 4 года назад

    nice tutorial! I actually built the app along with this tutorial but I made it using React Hooks so it was nice exercise for that as well

  • @glup3255
    @glup3255 5 лет назад

    I have only watched this video so far, but you have already earned a new subscriber!
    Keep making great Videos!

    • @Classsed
      @Classsed  5 лет назад +1

      Thanks, I will ;)

  • @miliakhaled9990
    @miliakhaled9990 4 года назад

    the trick in the end of video was really helpful, thank you !

  • @guilhermegirardi
    @guilhermegirardi 4 года назад +1

    Well done!

  • @Lambdaphile
    @Lambdaphile 4 года назад

    Wonderful introduction! Only thing I found confusing is you not mentioning what "generics" a.k.a triangle brackets are.

  • @royalflush13
    @royalflush13 4 года назад +3

    I came here to brush up my knowledge on TypeScript and ended up learning about refs

  • @arwahsapi
    @arwahsapi 4 года назад

    This channel is damn good but underrated! Thanks you're awesome mate!

    • @Classsed
      @Classsed  4 года назад

      aww, thanks, it's just cuz I stopped for a while, it's gonna grow now that I'm back ;)

  • @barictj
    @barictj 5 лет назад

    Nice video, quick and to the point.

  • @Ololololomm
    @Ololololomm 5 лет назад +2

    well really confusing if you new in ts, but still good, and it will be great if u do ts + react hooks video

  • @ITKAMASUTRA
    @ITKAMASUTRA 5 лет назад +2

    thank you for this short usefull video

  • @karamcsand
    @karamcsand 5 лет назад +1

    Okay, so if it does not install typescript
    > yarn create react-app my-app --typescript
    Then check node version to use the appropriate one
    > nvm use v8.10.0
    It also worth a try to install globally creat-react-app 2.1 (newest version is 3.1 today)
    > npm install -g create-react-app@2.1
    or install typescript globally
    > npm install -g typescript

    • @Classsed
      @Classsed  5 лет назад

      you dont need typescript globally, just use CRA version 3

    • @karamcsand
      @karamcsand 5 лет назад

      @@Classsed Thanks. I believe node version was the root cause. It just made me crazy that CRA did not give me an alert "hey, I do not install ts version, because something is missing". It just did not do it. Again and again.

    • @Classsed
      @Classsed  5 лет назад

      that's strange, I wouldnt think the problem would be from node, I personally use npm and have CRA installed on my machine, but hey as long as the error is gone now that's good :D

  • @craigjohnson8279
    @craigjohnson8279 5 лет назад +3

    Great video. Please do more with React and TypeScript, possibly with Hooks.

    • @Classsed
      @Classsed  5 лет назад +2

      I will be releasing a React video soon using hooks, but without Typescript (because TS isnt for all projects), but if you want to add TS to it, it's not much work actually, I might even create the same project in TS and post a github repo to it.

  • @elvisye3011
    @elvisye3011 5 лет назад

    Thank you for creating this video. It helped me alot to get started using TS

    • @Classsed
      @Classsed  5 лет назад

      you're welcome Elvis, I'm glad you made use of it :D

  • @kinansharif7055
    @kinansharif7055 5 лет назад +1

    when you do Component
    what is behind the scene with the angle brackets ?

    • @not2day646
      @not2day646 5 лет назад

      That's one of the more advanced typescript features. You can look it up here www.typescriptlang.org/docs/handbook/generics.html

  • @shahosoltani3396
    @shahosoltani3396 4 года назад

    You nailed it.

  • @zathkal4004
    @zathkal4004 3 года назад

    Awesome job mate.... how much difference would it make if we use axios instead of fetch? In terms of adding types etc,.
    Thanks in advance (:

    • @Classsed
      @Classsed  3 года назад +1

      no difference at all, I'd only add types to the returned value of the request (I'd do that with fetch too) I'm remaking this tutorial soon :)

  • @tenchobarros
    @tenchobarros 5 лет назад +1

    Awesome tutorial....one thing... if you add .toLowerCase () on this.pokemonRef.current.value you can search pokemons with capital letter.

    • @Classsed
      @Classsed  5 лет назад

      That's right, good idea :D

  • @Skia_
    @Skia_ 4 года назад +1

    Hello,
    Sorry but i'm a newbe ;D
    Why would you create a DOM element ref?

  • @usmanmughal5916
    @usmanmughal5916 3 года назад

    Best Tutorial.

  • @cesarpriego8380
    @cesarpriego8380 5 лет назад

    Hi Ahmed. What do you prefer and why? react JS or JSX?

  • @ahmadsalih6844
    @ahmadsalih6844 4 года назад

    what a nice tut, keep it bro

  • @coltdream7162
    @coltdream7162 5 лет назад

    我之前用Vue,但是现在,我用React, 因为当我了解完React的时候,我发现React真的比Vue好太多了,现在我最爱的就是React,尤其是React+Typescript!I love React + Typescript!

  • @c_mcdonnell
    @c_mcdonnell 5 лет назад

    At 25:07, you had previously initialized error as false. However, on page load you hadn't searched for any Pokemon. Therefore your conditional render that checks for error saw error false and displayed the Pokemon details, of which there were none because the page just loaded and the search hadn't been done yet.

    • @Classsed
      @Classsed  5 лет назад

      Exactly, this is why I needed to check for both "not loading" (!loading) and that the pokemon is null

    • @c_mcdonnell
      @c_mcdonnell 5 лет назад

      @@Classsed Gotcha, sorry I got distracted towards the end and missed adding the extra check. Thanks for the video.

  • @rtnjo6936
    @rtnjo6936 4 года назад

    Just came from codeacademy tutorial. Man Ty! When i get a job i return a debt!

    • @Classsed
      @Classsed  4 года назад

      you're welcome bro :) which codeacademy tutorial you're talking about BTW? :D

    • @rtnjo6936
      @rtnjo6936 4 года назад

      @@Classsed ruclips.net/video/m_u6P5k0vP0/видео.html this one. I love long videos like this, and btw your channel has at least 3 big projects) cant wait to learn them all

    • @Classsed
      @Classsed  4 года назад +1

      awesome! have fun :D

  • @hailahong3021
    @hailahong3021 4 года назад

    you can write html inside {}? i didn't know that. thank you

  • @returnZeroo
    @returnZeroo 5 лет назад

    You deserve more subscribers

  • @jamiejoaomendozasernaque731
    @jamiejoaomendozasernaque731 4 года назад

    Good video, a terribly messy code but it can be improved, also you can make better use of typescript and its syntactic sugar to improve all that disorder

  • @RedVelocityTV
    @RedVelocityTV 5 лет назад

    Great job explaining mate

  • @MarkKevinBesingaWebDev
    @MarkKevinBesingaWebDev 4 года назад

    hi what is the vscode plugin you use on formating typescript of save?

  • @GunturThunder
    @GunturThunder 4 года назад

    do you have part 2 ?

  • @maheshsangam6212
    @maheshsangam6212 4 года назад

    Sir thanks a lot for teach such a great React with Typescript but for me im getting problem in
    ./src/components/PokemonSearch.tsx
    Line 54:9: 'resultMarkup' is assigned a value but never used @typescript-eslint/no-unused-vars
    how can i solve this problem???

  • @emmanuelo1177
    @emmanuelo1177 5 лет назад

    Nice. Thanks for this.

  • @baba_yaga9
    @baba_yaga9 3 года назад +1

    Still didn't get the point, if wanted to use TS then y not simply use Angular? I mean first learn React then implement TS, it's confusing! Then what was the point for developing React in the first place?

    • @Classsed
      @Classsed  3 года назад +1

      React is easier to learn than Angular, has more packages to work with, more community support, Angular is an opiniated framework thats made for bigger teams and projects imo

    • @baba_yaga9
      @baba_yaga9 3 года назад

      @@Classsed I see! Damn you explained the concept in just 4 lines while I had been looking for days on internet, still didn’t get the satisfactory answer! Kudos man

  • @themanthelegend7048
    @themanthelegend7048 4 года назад

    IM gonna go catch'em all now.

  • @D1oBrando
    @D1oBrando 4 года назад

    Class components have been deprecated in React quite a while ago. You'd need to shift tutorial to React.FC

    • @Classsed
      @Classsed  4 года назад

      they haven't been deprecated, just not used anymore, you can write everything that you see here in functional components instead

    • @Classsed
      @Classsed  4 года назад

      And I'll remake this video soon anyway :D

  • @andikasaputra1390
    @andikasaputra1390 5 лет назад +1

    I got no hot reloading after save my work. What should I do?

    • @fatherfunny4627
      @fatherfunny4627 5 лет назад

      You can use
      npx create-react-app app-name-goes here --typescript

    • @andikasaputra1390
      @andikasaputra1390 5 лет назад

      @@fatherfunny4627 its because too large workspace. And I just set max_user_watches

  • @nikbelikov
    @nikbelikov 5 лет назад

    Cool! Thanks a lot!

  • @andreasschieferbein5547
    @andreasschieferbein5547 4 года назад

    I have a question.
    Could PropTypes do the same like interfaces in Typescript?
    I also could define props there, which kind of value this props will have and many more.
    I am not familar with Typescript but with PropTypes.

    • @Classsed
      @Classsed  4 года назад

      You're right, PropTypes do ensure that the values they recieve are of the types specified, however, PropTypes doesnt raise the error in compile time but only at run time. but they do the same thing when it comes to type checking.

  • @jmdavaul
    @jmdavaul 5 лет назад

    I was able use the fetch and return values to the screen, but only when hard code the identifier (e.g. pikachu) .. its value is always null for me (as in const inputValue = this.pokemonRef.current.value; is always null). Did anyone else have this issue? This is my input element

  • @leonardodiehl260
    @leonardodiehl260 4 года назад

    Excellent tutorial friend, I really appreciate. Straight to the point, very clarifying.
    There were just two things I would like to give as feedback for you to improve, as you clearly have a lot of potential:
    - I would split chunks of coding and "seeing results" inside the app. Doing all the code in just "one sitting" can make it difficult for some viewers to remember all the changes you're making at once. In my opinion, it's friendlier to progressively see the results of code.
    - The second thing gets solved with the first tip, I would recommend you to save your code more often, to let the prettier beautify your code more often and make it more pleasant for us to read.
    I hope you make good use of my feedback, keep going with the good work bro! (:

    • @Classsed
      @Classsed  4 года назад +1

      - Yeah, I should show results more often, it's just that sometimes I wanna write more code, running it then explain, as going back and forth inflates the length of video and that might scare some people of.
      - and yeah, I should save and format more often, this is a bit alien to be because when I'm following a tutorial I'm almost not even look at the video, just listening and typing haha.
      Thank you for the feedback :)

  • @muhammadahsan2292
    @muhammadahsan2292 4 года назад

    PIKA! PIKA!

  • @karamcsand
    @karamcsand 5 лет назад

    What if this command does not create .tsconfig and .tsx files but only the .js files like in a normal react install?
    > yarn create react-app my-app --typescript
    I have tried reinstalling several times with yarn and npx, refreshed create-react-app and npm, but it still does not provide typescript
    > yarn global list
    yarn global v1.15.2
    info "create-react-app@3.0.1" has binaries:
    - create-react-app
    ✨ Done in 0.18s.
    > npm list -g --depth=0
    /Users/username/.nvm/versions/node/v8.9.4/lib
    ├── create-react-app@3.0.1
    └── npm@6.9.0

    • @JipingWang
      @JipingWang 5 лет назад

      create-react-app myapp --typescript
      It will create a lot settings, including tsconfig, but all hidden.

  • @2007pradipta
    @2007pradipta 5 лет назад

    Getting error just after creating the Project and try tun NPM Start . Error : error Failed at the ts-react@0.1.0 build script.

    • @kresimircosic3753
      @kresimircosic3753 5 лет назад

      mkdir project
      cd project
      npx create-react-app ./ --typescript
      I have no idea how you get errors from a prebuilt CRA package. Let me know if it helped.

  • @0x6e95
    @0x6e95 5 лет назад

    Which VS Code Theme are you using?

    • @avinashnaik702
      @avinashnaik702 5 лет назад +1

      I guess Monokai!

    • @Classsed
      @Classsed  5 лет назад +1

      A custom theme, based on Monokai Dark Soda

  • @viniciogomez9863
    @viniciogomez9863 5 лет назад

    What are your extensions?

    • @Classsed
      @Classsed  5 лет назад +1

      Go to my VS Code extensions video, they are all listed there

  • @amandayi5011
    @amandayi5011 5 лет назад

    Maybe We not is must use TS, because more developer and company is not solow ,

    • @Classsed
      @Classsed  5 лет назад

      it's not a must, but it fits a lot of projects and scenarios.

  • @bessamzaghden5551
    @bessamzaghden5551 5 лет назад

    great job!

  • @arnobchowdhury9641
    @arnobchowdhury9641 5 лет назад +1

    3:12 Thanks for saying it is annoying to get into. Because, it is. I am kind of forced to learn this.

  • @briemens
    @briemens 5 лет назад +1

    You should not disable the null check!! Why bother introducing types and a linter in your system to then disable an actual valuable rule! You should check if `this.pokemonRef` is not null, then check if `this.pokemonRef.current` is not null and only then grab the value. Basic JavaScript stuff, you don't need typescript for this. This is why people reach out to Typescript, they don't do the basic null and undefined checks.
    And interfaces are not a pro by itself. You don't want interfaces for the sake of interface. You want type checking and interface are a mean to get there.

    • @Classsed
      @Classsed  5 лет назад

      Not really, I should disable rules that slow me down for not much to be gained, I know I'm attaching this ref to an input in my markup so the value of it in runtime will never be null sowhy add an extra if statement.
      Plus there are a lot of other linter rules that are disabled by default because they just enforce an opinionated way of writing code, if I were to enable all of them it would slow me down drastically for not much gained. you could use them in bigger projects, when collaborating with other developers or when writing 3rd pty libs.
      And I did mention that interfaces are a pro because of type checking, intellisense and predictability so I dont know what you're on about there.

    • @briemens
      @briemens 5 лет назад +1

      ​@@Classsed You turned it off for the whole project. So no null checks at all. The risk that you accedentially run into a null or undefined issue is probably higher than passing in number where a string was expected. I agree with you about slowing down for not much to be gained, hence I don't use typescript, but I wouldn't suppress linting rules like these tbh.
      I worked in C# for over 10 years and moved to JavaScript to get rid of all the boiler plate code and high noise to signal ratio of types and interfaces. JavaScript was liberating. Never had the need to introduce types. Just defensive programming and simple functions with arguments that are intuitive. The most common errors I ran into the last 10 years with JavaScript are, again, null and undefined errors.

  • @137dylan
    @137dylan 2 года назад

    This video should be marked as class components only, or to be truly fair it should be marked as deprecated. I appreciate that won't help your viewing numbers but if someone comes across this video thinking they're going to learn how to use TS with React nowadays, they're going to be misled.

  • @coltdream7162
    @coltdream7162 5 лет назад

    I love React ! I love Typescript ! and its more better than vue

  • @chiefdan07
    @chiefdan07 4 года назад +1

    Not only is your code garbage but this shows more of making a useless app with TS and not focusing on the TS part of things. Poorly done tutorial and would not recommend.

    • @Classsed
      @Classsed  4 года назад

      true, the app useless haha, it's just like a playground for showing off TS features, what TS things that you think are missing in this tutorial, it's been so long, I might remake this in a better way :D

  • @MaksymMinenko
    @MaksymMinenko 3 года назад +1

    No classes, please. We need hooks.

    • @Classsed
      @Classsed  3 года назад +1

      I'm remaking this video soon, all my new series and vids are using hooks

    • @MaksymMinenko
      @MaksymMinenko 3 года назад

      @@Classsed Classsed --> Hooked ;)

    • @Classsed
      @Classsed  3 года назад +1

      nice one 👍😂

  • @MrVitowo
    @MrVitowo 4 года назад

    I have an CORS error, what should i do ?