How to use TypeScript with React... But should you?

Поделиться
HTML-код
  • Опубликовано: 18 апр 2021
  • Learn how to setup React with TypeScript. Compare the pros and cons of using TypeScript in an React project. Learn more in the full course 👉 fireship.io/courses/react-nex...
    #js #react #typescript
    🔗 Resources
    Full TypeScript Video • TypeScript - The Basics
    TS Docs www.typescriptlang.org/
    Create React App with TS create-react-app.dev/docs/add...
    🤓 Install the quiz app
    iOS itunes.apple.com/us/app/fires...
    Android play.google.com/store/apps/de...
    🔥 Get more with Fireship PRO
    Upgrade to Fireship PRO at fireship.io/pro
    Use code lORhwXd2 for 25% off your first payment.
    My VS Code Theme
    - Atom One Dark
    - vscode-icons
    - Fira Code Font

Комментарии • 1,2 тыс.

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

    the ending was by far the best one i have seen 😂

  • @somedevstuff5060
    @somedevstuff5060 3 года назад +421

    Now I watched the full ad at the end cuz i thought the video was not finished. Genius move!

  • @cerulity32k
    @cerulity32k 2 года назад +404

    Coming from a lot of C# and OOP, I started with TS and loved it way more than JS. Being able to ensure a variable type is extremely useful and more readable.

  • @julianhecker944
    @julianhecker944 3 года назад +611

    now we need one of these great videos on TDD

  • @thedigs8563
    @thedigs8563 3 года назад +652

    That ending tho... nice one fireship

  • @nirmalmattmusic3993
    @nirmalmattmusic3993 3 года назад +605

    OMG. He is a mentalist. Today I started learning typescript with react.

  • @SCREENLURKER
    @SCREENLURKER 3 года назад +519

    Yes. Code overhead is a fact of life, writing more code is a reasonable trade-off for rock solid reliability through the development process. TS all the way!

  • @azzmounaim7696
    @azzmounaim7696 3 года назад +29

    No bullshit...pure content..saves you a ton of hours jumping between blogs and tutorials.I would say you have an amazing talent at condensing content and put it in simple forms.

  • @KevinVandyTech
    @KevinVandyTech 3 года назад +489

    After using TS with my react projects for the last 5 months, compared to the last 2 years with only JS, the difference is night and day. I can really never go back.

  • @BenjaminMillam
    @BenjaminMillam 2 года назад +6

    Thanks! This was the perfect quick overview without having to dive into a 3-hour start-from-scratch tutorial.

  • @kylemckell
    @kylemckell 3 года назад +247

    I read a really good article by Kent C Dodds on how to write a React Component with TypeScript, and he suggests to not use the `const Component:React.FC = (props)` (as seen

  • @VeraVeraniego
    @VeraVeraniego Год назад +5

    Love the fact that you made us think by ourselves if we should use React along with TypeScript, I wasn't expecting that. That's an enhance for your viewers critical thinking.

  • @jacked6
    @jacked6 Год назад +4

    I began using TypeScript with React for the last few projects I been working on. At first a lot of frustration trying to get around all the type cryptic errors that kept popping up and adding to frustration and development time to the most simple tasks. Now with practice and expierence TypeScript has actually grown on me and all the code hinting I get from it is so nice to have. The cons are yes you have to write a ton more code especially as you create Interfaces for each component's props but as your app scales you will be happy you did. TypeScript definitely a must have for me now.

  • @mohammedaliagha7520
    @mohammedaliagha7520 3 года назад +354

    Loved the ending 💙

  • @snakemanluffy7645
    @snakemanluffy7645 3 года назад +5

    I always thought typescript is somewhat confusing to learn. But after watching your video It seems easy. I know there's way more to it. But amazing none the less. Tnx 🥳

  • @alicanyenidogan
    @alicanyenidogan 3 года назад +121

    I started using typescript for the first time 6 months ago when I switched my job and started as a react developer. I've been coding js long enough and wasn't happy that they were using ts instead of vanilla. Oh man I was wrong. TypeScript is great and everything i wanted JS to have. Give it a try if you haven't.

  • @IceMetalPunk
    @IceMetalPunk 2 года назад +30

    I just started learning TypeScript recently, and the first thing I did was implement various functional interfaces (Consumer, Predicate, Supplier, etc.) and the Optional class from Java. Because I love them. Could I have done that in pure JS? Sure, of course. But generics and strict typing make them

  • @tomasgoncalves2104
    @tomasgoncalves2104 3 года назад +67

    Great video as always, would love to see you talk about test driven development more in depth

  • @lionbrunch4244
    @lionbrunch4244 3 года назад +48

    A few hours ago I started a university project that requires React with Typescript. This video follows shortly after. I don't know how you choose your timing but it's awesome!

  • @MrMudbill
    @MrMudbill 2 года назад +69

    I took over a React project in JS almost a year ago. I shifted it towards TypeScript around April. I am so glad I did, it really is fantastic once you get over the initial hurdle of "why is my compiler complaining? I know my code!"