React JS Crash Course (2019)

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • In this crash course you will learn what React JS is and the fundamentals such as components, state, props, JSX, events, etc.
    Modern React Front To Back - 13.5 Hour Course
    www.udemy.com/...
    Code For Tutorial:
    github.com/bra...
    💖 Become a Patron: Show support & get perks!
    / traversymedia
    Related RUclips Videos:
    Redux Crash Course - • Redux Crash Course Wit...
    React Context API Project - • Lyric Search App With ...
    React Hooks - • Introducing React Hooks
    Learn The Mern Stack - • Learn The MERN Stack [...
    Website & Other Udemy Courses
    www.traversymed...
    Follow Traversy Media:
    / traversymedia
    / traversymedia
    / traversymedia

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

  • @TraversyMedia
    @TraversyMedia  3 года назад +30

    This is the 2019 version which uses class based components. The 2021 version with hooks has just been released - ruclips.net/video/w7ejDZ8SWv8/видео.html

    • @NinjaAhmed-cp3pe
      @NinjaAhmed-cp3pe 3 года назад

      first reply

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

      which one should I watch first. Please reply

    • @NinjaAhmed-cp3pe
      @NinjaAhmed-cp3pe 3 года назад

      @@abhishekmaira9769 not this one

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

      @@NinjaAhmed-cp3pe can you please explain why? ... doesn't this use basic class-based components. Sorry I am a beginner and wanted to know which video to start with first

    • @NinjaAhmed-cp3pe
      @NinjaAhmed-cp3pe 3 года назад

      @@abhishekmaira9769 watch the 2021 one

  • @abbashussain7298
    @abbashussain7298 5 лет назад +2365

    Hey there Brad,
    just one note- DON'T apologise for the length. you're not a waffler or a rambler, this 1.5 hour tutorial was 99% useful information so even if it was 3 hours long most people (including and especially me) would watch it without fretting about the length due to the value
    Your crash course was informative and intuitive with complicated things made simple. When you were about to do something, I would try to do it myself first and then I would come back and see your solution which is why it took me a whole day to get through it!
    you helped me get into web development and i'm happy to keep consuming your content, thank you very much Sir

    • @algeriennesaffaires7017
      @algeriennesaffaires7017 5 лет назад +43

      100/100 true i was wondering why he is excusing giving us a great lesson

    • @karpeevkonstantin9564
      @karpeevkonstantin9564 5 лет назад +22

      +1 Please, don't apologize, Brad. You're doing a great job!

    • @zacnetic3103
      @zacnetic3103 5 лет назад +9

      I agree, it takes time to learn these sorts of things and it is something that cannot be rushed. Thanks Brad

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

      Word

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

      1.25x or 1.5x is sufficient

  • @JuanAndOnly
    @JuanAndOnly 5 лет назад +657

    import GreatCrashCourse from './TraversyMedia'
    export default HitLikeButton

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

      Awesome! :)

    • @salman4430
      @salman4430 5 лет назад +6

      ; important
      import GreatCrashCourse from './TraversyMedia';
      export default HitLikeButton;

    • @AjayKumar-ts5jd
      @AjayKumar-ts5jd 4 года назад

      where can i refer for shortcuts like core css codes directly. i am beginer !

    • @AshuSingh-us5tp
      @AshuSingh-us5tp 4 года назад

      So basically HitLikeButton is the name of class otherwise it'll give error

  • @faboneproject918
    @faboneproject918 5 лет назад +826

    Thought I would share this...
    # Creating Class Component
    20:48
    # State
    22:52
    # Passing State as Prop to Component
    24:57
    # Looping through props and output
    26:17
    # Adding key to list item
    31:19
    # PropTypes
    31:56
    # Style components
    34:07
    # Add style to a method
    35:46
    # Why arrow functions and .bind(this)
    41:33
    # Component drilling
    42:26
    # Passing props through methods using component drilling
    45:57
    # Deconstructing
    46:35
    # Updating state through a method
    47:57
    # Toggle state
    49:18
    # Submit events
    1:09:21
    # React Router
    1:15:30
    # Links
    1:23:29
    # Http GET request
    1:25:56
    # Http POST request
    1:30:12
    # Http DELETE request
    1:32:51
    # Adding PropTypes
    1:34:31

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

      thanks for this

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

      you absolute unit! loveya.

    • @octaviosiqueira
      @octaviosiqueira 5 лет назад +7

      One of the best comments in RUclips history.

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

      Thanks a lot! Just in the # Http GET request, it is not 1:23:56, it's 1:27:56. Although IMHO there should be a section before this one because he explains about the Axios library at 1:26:53.

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

      Oh god thanks god for this comment !! you added as much value as the video it self ! you r the best dude !

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

    Got here thanks to ChatGPT

  • @marklholloway
    @marklholloway 4 года назад +121

    Me: Clicks this video
    Ads: You’re wasting your time watching online coding courses
    Me: Skips Ad 😀

    • @EmekaMbah
      @EmekaMbah 3 года назад +6

      you should watch the AD that's how he get's paid :)

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

      @@EmekaMbah gr8 thought

  • @neenaw
    @neenaw 4 года назад +359

    If you have a problem with uuid do this:
    import { v4 as uuidv4 } from 'uuid';
    id: uuidv4()

  • @Chandasouk
    @Chandasouk 5 лет назад +505

    Brad, you are a magnificent beast.

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

      Ikr

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

      The best good guy brad on the planet

    • @mufaddalkhozema4334
      @mufaddalkhozema4334 5 лет назад +9

      To be completely honest, I am really scared of him because of how good he is at coding. I guess at least he is using his powers for good.

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

      Leslie at it again?

  • @marredcheese
    @marredcheese 5 лет назад +152

    The checkboxes should match whether the todos are completed. To achieve that, update the render method in TodoItem.js like this:
    const { title, id, completed } = this.props.todo;
    ...

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

      Good observation!

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

      Thank you! I was trying to figure out how to fix that!

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

      and add this in checkbox

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

      ​@@kifahandary8126 I think we wont need that since we are getting the checked information from App.js and it works without doing so, would appreciate if you give details about why to use that line?

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

      I was trying to figure out the same thank you :)

  • @sk32md
    @sk32md 4 года назад +58

    BEFORE YOU START
    npx create-react-app todo --scripts-version 1.1.5
    BEFORE YOU START
    so you have classes instead of functions and can follow along the tutorial
    on VSCode you can also run react pure to code extension to convert if you are running this is 2020
    thanks to Chad C. for the info

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

      Thank You! I've been trying to figure out how to switch version so I can follow along, I was on the verge of giving up! This is very useful

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

      Thanks this was really helpful

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

      Thank you man... wasted too much time on this before i saw your comment

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

      Siamak you're one beautiful son of a bitch

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

      After an hour surching for a solution I stumbled upon Mr Kosari. Much obliged!

  • @johnniestang
    @johnniestang 4 года назад +21

    At 20:04, Emmet magically works with JSX :)
    I had to look this up so it may be helpful to others as well ...
    To get emmet to work with JSX, do the following:
    - Open Settings ( ctrl + ,)
    - Go to Workspaces
    - Select "emmet"
    - Select "Edit in JSON"
    - Add the following:
    ```{
    "emmet.includeLanguages": {
    "javascript": "javascriptreact"
    }
    }```

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

      Thanks man!

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

      This worked. Thanks dude !

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

      Thanks for this

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

      This is why I love internet, people are really kind here.

  • @RogerNorling
    @RogerNorling 5 лет назад +32

    Traversy Media, Thank you for this video, a great start for those venturing into ReactJs.
    There is one important point you did not bring up concerning state is that of immutability. The react framework rely, at least in part, on state changes being new objects, not the same objects mutated. The place you make a mistake is at 49m. The todo will be mutated by the act of toggling the completed property, which means that even though map returns a new array, the old array will have a mutated element, the todo object being changed. The markComplete can be changed in the following way to support an immutable update:
    markComplete = (id) => {
    this.setState({ todos: this.state.todos.map(todo => {
    return todo.id !== id ? todo : { ...todo, completed: !todo.completed };
    }) });
    }
    This uses the ternary operator and reversed condition, but it is equivalent. The important difference is in the object literal where the spread operator is used on the todo object. This creates a new object with the same properties and associated values as the prior todo object. The extra completed property takes the place of the property from todo since it comes later in the object literal.
    For more complex data structures, either simplify the structure, or use one of the available libraries for handling data in an immutable way. The ReactJs documentation has some suggestions.
    On a similar note, at 56m25s, the return value of filter is a new array, and since no element is actually changed the spread into an array is superfluous.

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

      this should be upvoted, great point

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

      Great observation and correction! So often I see people point out when something is wrong, but offer no alternative solution.

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

      Why does React Framework rely on changes to state objects being new objects?

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

      @@lasithk5914
      1) Reacts wants to know which components have changed their state and props to avoid re-rendering everything. (see React.PureComponent)
      2) You can implement Undo-Redo easily.

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

      3) If there are multiple setState calls coming one after another Reacts merges state changes and re-renders the component only once.
      This is the reason why Roger Norling's example is also unconventional.
      You shouldn't copy this.state directly.
      Instead, pass a callback:
      markComplete = (id) => {
      this.setState((prevState)=> { todos: prevState.todos.map(todo => {
      return todo.id !== id ? todo : { ...todo, completed: !todo.completed };
      })
      });
      See:
      reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous

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

    Nice job man, very good tutorial! Somehow it is really easy to understand.

  • @Quuton
    @Quuton 3 года назад +30

    pro tip: 1.25x speed is barely any difference and makes you not have to spend so much time :D

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

      That tip got no use coz i can already understand at 1.75x speed 😂😁

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

      @@neillunavat bruh! :D :D

  • @bonchan4404
    @bonchan4404 4 года назад +64

    Actual tutorial : 1 hour and 38 minutes ,
    me : 5 hours
    but still JARGON to me , need to watch this again tho ahahaha

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

      If you haven't already you should go through his 'Node.js crash course' then 'Express JS crash course' then come back to this one.

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

      This course is perfect.
      But, if you don't understand you can try Mosh's React for Beginners. It's slow paced and really beginner friendly.

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

      same

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

      @@@MrPacalicious do we need to know node.js before learning React?

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

      @@katheyjohn93 no but i found this easier to understand after going through a node.js course

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

    *DEPRECATED UUID FIX* - if you get stuck here 1:14:46 at UUID, note this:
    ```
    const uuidv4 = require('uuid/v4'); //

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

      Thank you for helping us :)

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

      @@edwardtofan8783 ironically I'm having a very tough time with React. I'm pursuing VueJS instead BUT One time I was taking an EJS class online and there was an outdated framework in the class. One of the comments had a fix for it and it was a lifesaver. I happened to figure this out and figure that I wouldn't be the only person with the same problem so I'm thrilled if it actually worked for you.

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

      Thank you for fully spelling it out for us :))

  • @jaggyjut
    @jaggyjut 4 года назад +31

    please note that uuid has changed their declare, this one works for me:
    import { v4 as uuidv4 } from 'uuid';
    id: uuidv4()

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

      Thanks!!

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

      Thanks !!

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

      Thanks !!

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

      or you can just use import * as uuid from 'uuid', and then use uuid.v4()

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

      Dude, I've spent like 30 minutes looking online, why don't you put it on
      stackoverflow.com?

  • @caionomar
    @caionomar 5 лет назад +38

    Dude, that was intense! Great tutorial. Walked in not knowing anything about React, left like I have learned a shit load. Thank you!

  • @farhanqureshi8811
    @farhanqureshi8811 3 года назад +9

    An expert teacher who's words are priceless, spending so long to try and explain in such a beautiful manner and then apologizing for taking long. You are a hero ! I am starting to love React after I have seen this video. There were so many barriers in me learning React, so much scattered information but this video is one stop shop

  • @lucaciandrei
    @lucaciandrei 5 лет назад +56

    Great course:
    56:28 : no need for the [... this.state.todos.filter ...] since the filter method will automatically return an array. You're deconstructing then reconstructing the array -> it's redundant.

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

      I was having trouble understading this, thanks for the explanation

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

      I was wondering about this as well. Was the intention of using spread operator is to make a copy of the array, rather than modifying the existing one?

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

      @@WayneSzeto yes

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

      @@WayneSzeto So what would be the downside of modifying the existing array?

  • @pauliewalnuts6734
    @pauliewalnuts6734 4 года назад +15

    simply amazing, only thing i would say is maybe do a functional version. This is because create-react-app now comes with "function App()" as boiler plate instead of "class app" like before.

  • @artlos1388
    @artlos1388 5 лет назад +31

    There's no way I learn a new language without watching your videos first!

  • @devongrey1237
    @devongrey1237 4 года назад +11

    Can you make an updated crash course using the functional style?

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

    Is it bad to keep using class components even for a todo-list item instead of functional components?
    I hate this react hook nonsense and want to keep using classes and pass data through props and state

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

    For those that are struggling cos can't access the props because you are using function component instead of class component, you just add a parameter to the function component, what I mean is:
    function Todos(props) {
    return (
    props.todos
    );
    }

  • @huyminhtran9090
    @huyminhtran9090 5 лет назад +89

    For Windows users, if you are unable to npm create-react-app then you can use :
    "npm install -g create-react-app
    npx create-react-app"
    I ran into trouble and those two lines solved the issue.

    • @aleem.akhtar
      @aleem.akhtar 5 лет назад +7

      May be for experienced programmer, this solution will not have any worth. But for me, you sir, just saved my day. kudos

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

      nodejs8.0+ is OK every

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

      Thank you!!!

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

      Thank you so much, was tearing my hair out at this

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

      thanks alot!!

  • @freak0nature24
    @freak0nature24 5 лет назад +20

    I have a bachelor's in Web Development and Design and I think I've learned/retained more from this video than I did from my course on React. Very well done, man!

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

      Bachelor's in Web Development and Design? Is that even a thing?

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

      That doesn't exist kid

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

      @@l2ob1222 some universities in my country offer a Bachelor in Web Development so i wouldn't discredit him

  • @MightyArts
    @MightyArts 5 лет назад +54

    You are reading my mind Brad! Was just thinking of starting off with a framework which most likely will be React now in the new year, and here you are! Been following your channel for almost a year now, learned a lot from you! Bought the modern javascript udemy course from you, learned tons of new stuff. Will start looking for an entry level job or an internship next week, but given that I haven't yet started with a framework, this is right on spot. Happy new year and all the best!

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

      Same :)

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

      My boy Brad is a real life wizard

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

      Same!

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

      same here, Brad is cool

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

      Lol, he also reads my mind too. He knows what his students need at the right time. That a teacher!

  • @nasirhussain7552
    @nasirhussain7552 4 года назад +10

    For those who are seeing functions instead of class in app.js, use following command to create app
    npx create-react-app my-app --scripts-version 1.1.5
    Creadits: Chad c

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

      THANK YOU! There is more than one teacher at Traversy Media. It takes a village.

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

      Thank you; I spent awhile trying to figure out a solution to that on stackoverflow, and here it was the whole time.

    • @AjayKumar-ts5jd
      @AjayKumar-ts5jd 4 года назад

      where can i refer for shortcuts like core css codes directly. i am beginer !

  • @biilalakhtar3552
    @biilalakhtar3552 5 лет назад +72

    is anyone else seeing function App() instead of a class?

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

      Yep, I'm. I don't know if is some new change where u doesn't need to declare a class... idnk

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

      yes they change it , we can use hooks now for state in function components

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

      yes

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

      how did you solve that problem ?

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

      @@harismemon1546 Simply replace the functional App() with a class based App()

  • @BlessedMaple
    @BlessedMaple 5 лет назад +10

    This is quite confusing as to how to learn since that functional update. I'm sitting here at 20min into the video trying to figure out how to construct the todos variable and pass it on to Todos.js... What an unfortunate update :(

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

      i mean for the sake of just getting used to react I just ignored that and used classes instead. I assume once I get used to react I'll be able to figure the rest out. :)
      I still got a lot of value out of this crash course. thanks :)

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

      Same here! Anyone watching this anno 2020, just write out the code Brad is showing. Get it to work, get your feet wet. Then improve and make pretty and obide by new react laws.

  • @tarikouazzanitouhami2729
    @tarikouazzanitouhami2729 4 года назад +7

    On windows with visual code studio:
    1- Download and install Git
    2- Download and install Node.js
    3- Go to vs code terminal and check if everything is installed by doing the following:
    to check that everything is installed you should check the version of each installation: "git --version" "npm --version" "node --version"
    4- type "npm install -g create-react-app" in your terminal to install react
    5- Now you can create your react project by typing: "create-react-app "
    Followed the instructions in this webpage: makandracards.com/reactjs-quick/52419-install-reactjs-windows

  • @The_Soup_Wizard
    @The_Soup_Wizard 4 года назад +7

    Any plans of creating an updated course or a video that mentions how things are done differently with create-react-app's current build? I'm just having the worse time figuring out how some of the things have changed since render() doesn't appear to be used any more and the default is a function rather than `class todos extends Component {}`

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

      delete and update as per video. when he explains 'function component' you will figure out whats happening

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

      Im only 30 minutes in but so far just using his code works without breaking anything. Just change the import line and include the render()

  • @og6517
    @og6517 4 года назад +5

    If you're having issues following along with the tutorial (like I was) because in the video it shows classes using the extends declarations versus the newer syntax which uses functions. Just type: npx create-react-app . --scripts-version 2.1.2
    This creates the scripts with classes

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

      THANK YOU!!!! starting over (dangit!!!!)

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

      oh my god you are a fucking angel THANK YOU.

  • @geraldgeraffe2209
    @geraldgeraffe2209 4 года назад +23

    "Oh I forgot the s."
    Broswer

  • @fabioalexandrino2244
    @fabioalexandrino2244 5 лет назад +66

    I spent 6 days trying to figure out this whole tutorial. Now I finally did it in 40 minutes without seeing anything

  • @giftedfingers2580
    @giftedfingers2580 5 лет назад +26

    I'm so mad at my self, I've been doing hardcore JavaScript for so long my CSS skills are horrible.

    • @TraversyMedia
      @TraversyMedia  5 лет назад +23

      I have the course for you coming out very soon :)

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

      @@TraversyMedia what's your courses in 2019 brad

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

      check semantic UI. Its really cool and easy. check this step by step guide. videotutorialspot.com/2019/01/08/semantic-ui-for-react-install-and-getting-started/

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

      Semantics UI is no longer being supported. I would still recommend using Bootstrap at this point.

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

      and what about tachyons? I've been styling some things with tachyons.

  • @faisalm.2663
    @faisalm.2663 5 лет назад +6

    Brad common man, You don't need to apologize about the length of this crash course - This has been so far the most informative crash course I've ever taken. THANKS A LOT 🙌

  • @aditsapkota7862
    @aditsapkota7862 4 года назад +65

    Man, React is hard:(

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

    1:25:45 you don't have to apologize for the length of the video, most react tutorials are between 5-10 hour videos with mostly useless information. Great video
    Just one question can you make more react project tutorials without teaching anything new? (just the concepts in this video) Because I feel like I know it but not well enough to go and start making projects by myself and a react project walkthrough would be really helpful.
    Thanks for the video

  • @2Clean4This1
    @2Clean4This1 3 года назад +5

    Thanks Brad. I believed you when you told me what I needed to know in 2019 / 2020 to be a web developer - I listened to you religiously. I didn't even have access to internet at home, I would download your videos on my laptop in the dairy queen parking lot that had wifi and play them on repeat at home. Anyways, I'm now 3 months into a 6 month contract doing front end web development at a rate I thought I would need years of experience to get, and finally have the confidence to start applying to full time positions. THANK YOU!!!!

  • @xWildStorm7x
    @xWildStorm7x 5 лет назад +10

    Thanks for this crash course! It is pretty great.
    I have a question though, around 1:32:30, when I add the todos by doing a post request to the jsonplacerholder API, they always get added with the same id, 201. How do I fix this?

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

      add the following "res.data.id = uuid.v4(); " to the promise before setState in addTodo() , that would work.!

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

      Hey I have same question, did you manage to sort this out? I did not exactly get where Ganesh is saying to add res.data.id​ = uuid.v4();

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

      Ok first just sort out why we are getting 201 ids for every new item we add. Now theJSONPlaceholder has 200 pre-written todos in the API, so requesting a new list will always give you 201 as Id (even after adding limit=10 or more) which is normal for an API, but in our application, we can add our own Id by using "res.data.id = uuid.v4(); " to the response we get. I'll copy-paste the code here so things are clearer
      addTodo = title => {
      axios
      .post("jsonplaceholder.typicode.com/todos", {
      title,
      completed: false
      })
      .then(res => {
      res.data.id = uuid.v4();
      this.setState({
      todos: [...this.state.todos, res.data]
      });
      });
      };
      So in the promise, we are adding our Id to the response before setting the state. Hope this is understood.

    • @AjayKumar-ts5jd
      @AjayKumar-ts5jd 4 года назад

      where can i refer for shortcuts like core css codes directly. i am beginer !

  • @locktar-o-dark5664
    @locktar-o-dark5664 5 лет назад +5

    thx for work, Brad
    this.setState({todos: this.state.todos.filter(todo => todo.id !== id)})
    not need wrap in an array so like method filter() return array

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

      That was driving me crazy! :p

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

    Around 1:15:21 I was getting an error "Attempted import error: 'uuid' does not contain a default export (imported as 'uuid')" because uuid package used to have default export but it no longer does. To get around this in the import write it as
    import { v4 as uuid } from "uuid";
    and then you can use it as
    id: uuid() when assigning the id property

  • @antoinekaram2910
    @antoinekaram2910 4 года назад +28

    I would personally see this course sold for money, thank you for giving it to the community for free

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

    Really nice Video ...but there is a big problem. There is no render () function in the App.js in the newer React version . Does someone have the same problem?.

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

      yes I have the same thing, this is a big headache

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

      Just rewrite the code so it reflects the es6 class syntax used in this tutorial and wrap the return statement in a render function.

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

      @@nevuxxx Im not sure if i understand ..but thanks!. i keep trying....

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

    28:33 - An amazing extension being used here.
    Thanks a lot for the tutorial. Helps me a lot! I keep coming back to refresh anything that I missed.
    Below bookmarks have been commented by @Mukesh Kumar. Adding these to your description would be very helpful for people trying to navigate quickly through the tutorial.
    9:41 Start learning React (Introduction)
    11:15 Install Node.js
    11:34 Install React Dev Tools
    11:45 Github page for create React app
    12:05 Create
    20:48 Creating Class Component
    22:52 State
    24:57 Passing State as Prop to Component
    26:17 Looping through props and output
    31:19 Adding key to list item
    31:56 PropTypes
    34:07 Style components
    35:46 Add style to a method
    41:33 Why arrow functions and .bind(this)
    @ Component drilling
    45:57 Passing props through methods using component drilling
    46:35 Deconstructing
    47:57 Updating state through a method
    49:18 Toggle state
    1:09:21 Submit events
    1:15:30 React Router
    1:23:29 Links
    1:25:56 Http GET request
    1:30:12 Http POST request
    1:32:51 Http DELETE request
    1:34:31 Adding PropTypes

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

    Sir please don't say sorry again and again for time, every single second was worth it. You r an awesome instructor sir,keep creating awesome tutorials😋

  • @englishwithernesto91
    @englishwithernesto91 2 года назад +2

    Timestamps for this course:
    0:00 Intro
    8:16 Anatomy of a component
    9:42 Quick overview of the app to build
    11:13 Software requirements
    11:45 Creation and overview of app's boilerplate
    18:25 Running the server
    19:14 Performing basic cleanup
    20:45 Todos component

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

    I'm several weeks into the Udacity NanoDegree Program for React and have been pretty frustrated and lost but... I feel like I just learned more in the last 90mins from Brad than in the month I've been doing Udacity. Bless you sir. So glad I found your channel!

  • @nikolacvetanovski6602
    @nikolacvetanovski6602 5 лет назад +5

    Omg you are the real MVP, just started learning React on fcc but its boring to read and read... Thank you this will help to do a second part in your MERN stack course on udemy!

  • @asemzk
    @asemzk 5 лет назад +10

    Thank You SOOOOOO much.. I listened to every word and every detail
    A big THANK YOU from your biggest fan in Syria

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

    you helped me understand so much! please make part-2, on how to deploy on gcp/others, i would like to know the deployment stage. btw, after deploy on local, i open the build folder, index.html is blank unable to show anything, is this normal?

  • @soensaid
    @soensaid 5 лет назад +7

    So create-react-app now uses functions instead of classes. does anyone know if thats the preferred method of coding in react now?

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

      Since create-react-app updated since this video, I believe that now functions are preferred over classes.

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

      And that means this tutorial is quite outdated now, too.

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

      @@skepticalfrog It doesn't matter too much from the looks of it, you can use either one. Also Hooks have been added but even React said that they don't expect everyone to use it right away.

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

      @@FakeAssHandsomeMcGee_ True. Though learning hooks and functional component is quite easy anyway.

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

    Attention! If you are on Windows 10 and you have spaces in your username, REACT install will fail. Rather than spending days (like I did) looking for a fix. , here it is :
    Opened VS Code with Administrator rights.(fixed permission issue)
    Instead of using "npx" I tried the following:
    --> npm install -g create-react-app
    --> create-react-app my-app
    And that got executed successfully.
    credits to malhar234 on GitHub github.com/facebook/create-react-app/issues/6512

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

    You should update the video's title to React 2019 to get more views.

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

    The App.js class looks different on mine:
    import React from 'react';
    import logo from './logo.svg';
    import './App.css';
    function App() {
    return (




    Edit src/App.js and save to reload.


    Learn React



    );
    }
    export default App;

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

      That's what he talks about function based rather than component based. You can just refactor it to what he has on the video and study up on function based later.

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

      Here's the link on functional components: logrocket.com/blog/pure-functional-components/

  • @Joshca4
    @Joshca4 5 лет назад +25

    im switching to react from vue, Although vue is great and easy to learn i couln't find any jobs, i live in a 3rd world country and its hard to land one as a free lancer, so im going to learn react for now, thanks for the free course always awesome content.

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

      Jose, we're not 3rd world country. Don't put us on this low level.

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

      India is third world....Mexico is right next to USA...just jump the fence

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

      +I'm a Developer im from southeast asia more 3thrd world country, they pay us 300 USD /month as web developer

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

      Just an fyi 'Third World' actually means a counry that was neutral during the cold war...

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

      why not freelancing online?

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

    I notice that create-react-app now has the default App.js setup as an unclassed function that returns the App div, rather than using a component. Anyone know the rationale behind this?

    • @a.t.4628
      @a.t.4628 5 лет назад +2

      Hey, I don't know if you found the solution but I'm gonna answer this anyway.
      There are two types of React components: functional components and class components. The current version of create-react-app gives you a functional component by default. TraversyMedia has an older version which gives a class component. This is not a problem. You can edit your component freely and make it into a class component. Pause the video and change it like you see it on the screen or Google search for class component and you'll find examples.

    • @a.t.4628
      @a.t.4628 5 лет назад +1

      @@jonathanreno1022 I'm glad I could be of help!

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

      @@a.t.4628 thank you so much! it's really important to feel confident you're not getting something foundationally wrong when learning a new framework. Much appreciated.

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

    Man. I remember I started learning web dev last July. I began by watching your HTML only "landing page" tutorials over and over again until I memorized how to do them on my own without watching the videos. I would watch these other vidoes: project with node.js, express, mongo... etc. and I would think omfg wtf is that? I then did a JS course and now, a few months later, I'm working on learning node.js and I know what all that stuff is now lol. In a few months I'll be more than job ready : )

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

    You deserve more subscribers and more views.
    Thankyou for producing such informative and enjoyable content.

  • @TheAremoh
    @TheAremoh 5 лет назад +10

    Great tutorials as always. Django with React pleeeeaaase

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

    Awesome. Plz make updated redux crash course

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

    If you are getting function() instead of class in VS code, install 'react pure class' extension, and follow the instructions given in the extension description

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

    Okay guys, so Facebook developers are insanely productive making this tutorial obsolete. When we use "create-react-app" we get the new functional components, so there is no this and you have to use var or const when defining arrow functions. The hardest part I found was updating the state but don't worry. Instead of this.setState you have to use hooks.
    import React, { useState } from 'react';
    function App() {
    _state = {todo: ...}
    const [state, setState] = useState(_state);
    const toggleComplete = (id) => {
    let todos = state.todos
    setState(
    {
    ...state,
    todos: todos.map(todo => {
    if (todo.id === id) {
    todo.completed = !todo.completed;
    }
    return todo;
    })
    }
    )
    }
    return (

    );
    }

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

      I did ok with the snippets, rcc rcf rce, etc. But now I cant get them to worl=k.

  • @alishanali6722
    @alishanali6722 5 лет назад +28

    Hey Brad, what about react native? 😁

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

      He's a web developer, I don't think he will do it. No, I think he is interested in this topic but he has a lot to do with his webdev lessons so he just hasn't got time to do ReactNative.

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

      TheReverOcelot he has a paid react native course on eduonix which I bought and completed.

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

      @@alishanali6722 How do you like coding with React Native? The only reason I was thinking about studying React is because of React Native. Still haven't decided if I should dive deeper into React or Vue.

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

      Dan Cruz React Native is a game changer technology because you can replace ios and android developers giving you an advantage in the job market. React native is very easy to use if you are a javascript expert.

  • @deadli-us
    @deadli-us 4 года назад +5

    As an experienced web developer coming from a Backbone+Marionette background, this was the perfect introduction to React for me. Thank you and great job!

  • @antari363
    @antari363 5 лет назад +9

    "...Try to explain everything I do rather than just a watch-me-code video."
    Thank god. As an up and coming software engineer, I am bothered whenever people tell me to just 'type it in, it works. we'll teach you why some other time." I must know the how and why to everything I type in.

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

    Holy shit I have never seen a better tutorial in my life! You are a life savior and I wish the best to you, I hope you continue to make these amazing tutorials. And the amount of information you crammed into only an hour and a half is incredible! Thank you so much :)

  • @harshit.jindal
    @harshit.jindal 4 года назад +1

    For those who are getting "function App()" instead of a "class App extends Component" in App.js, use "create-react-app app-name --install-scripts 1.1.5" to build the app INSTEAD OF just using "create-react-app app-name". This would still give you the latest version of React, but it would just initialise the project with the class based component so you can follow along with the tutorial.

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

      Naaa. It still builds the functional component app

  • @nightowl1596
    @nightowl1596 4 года назад +9

    Please make a new react tutorial because the render() is no more :(

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

      also when I create the state, I get the error msg "State is not defined"

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

      i facing problem too

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

      its there...u have to use classes for that, not the default functions

  • @shuangli5466
    @shuangli5466 3 года назад +3

    idk why but i find his voice particularly charming

  • @fabioalexandrino2244
    @fabioalexandrino2244 5 лет назад +18

    insteaf of uuid, you can use Date.Now() to create an id

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

    Hi Brad, I am trying to reproduce your tutorial and I am stuck in 24 minute with state, when I run with npm start it gives an error about unexpected token, what I am doing wrong? is it the version of react that has changed since your video, is it something else?

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

    nice tutorial but I am stuck at 26.03. I get an error undefined cannot read property of todos , when I add todos property to the Todos class. Any help will be really appreciated

  • @fabricobjects-llc3581
    @fabricobjects-llc3581 5 лет назад +8

    I am a student of yours on Udemy. I am taking your MERN stack course but I haven't started yet because I am taking some prerequisite stuff. I will add this to my prerequisite list. Thank you!

    • @YaSir-uc6vl
      @YaSir-uc6vl 5 лет назад

      thankyou so much brad how can i thanks to you? you are brilliant

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

      Hi Fabric, how did you like the MERN course? Am thinking of taking it next?

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

      @@fabricobjects-llc3581 Thank you ! Will check it out, good luck in the course!

    • @fabricobjects-llc3581
      @fabricobjects-llc3581 5 лет назад +1

      @@eeeeee4756 I updated my reply to you to show some playlists that I use. For some reason the Academind playlist page doesn't show all his playlist; you have to use the page search function to see all of them. Good luck to you too!

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

    This is awesome.
    This is my first step to learn react, and now im not so intimidated. Huge thanks !

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

    Thank you very much sir. I started studying react few weeks ago. This came at the time I needed it the most.

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

    just one pointer for uuid -- for me i got an error so i fixed it by importing uuid as
    import uuid from 'uuid/v4'
    and then instead of this:
    id = uuid.v4()
    i did:
    id = uuid()

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

      yeah uuid package has changed, I had to check documentation to make it work, it is a bit different but still easy

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

    If you are having a problem w import uuid,
    you should change it to : import {v4 as uuid} from "uuid";
    then set id: uuid()

  • @toothstepper
    @toothstepper 5 лет назад +7

    please never apologize for any of your videos to be "really long" - it was worth every minute - gonna take your Front To Back MERN stack course now

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

    I just finished your MERN stack on udemy today, keep up with great content !

  • @rl1111rl
    @rl1111rl 5 лет назад +6

    FYI - App.js now has "function App()" rather than "class App" because it doesn't need the lifecycle methods. The tutorial used an older version of React.

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

      This is where I'm getting hung up, I stored the state in Todos component but now I'm having difficulty passing the data from AddTodo -> app.js ->TodoItem...

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

      @@derekdenhartigh3747 React sucks. Check out Svelte svelte.dev

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

      @@derekdenhartigh3747 import React from 'react';
      function Todos() {
      return (


      Todos


      );
      }
      export default Todos;

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

    I highly recommend reading the react website, reactjs.org/docs/hello-world.html starting here and reading the “Main Concepts” before this 😊 it helped me feel more comfortable

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

    For anyone who wants to really understand the javascript goin on in React, please check out Mosh's video. ruclips.net/video/NCwa_xi0Uuc/видео.html

  • @vikasni95
    @vikasni95 5 лет назад +5

    Render() {
    Return (
    {brad is god gift to all web developers across world}
    )
    }

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

      the first curly brace is not closed o_o

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

      @@sanjidnet ok😅😅😅

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

      @@vikasni95 lol thanks for fixing it mate :P
      now i can sleep

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

      @@sanjidnet 😅🤣🤣😂

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

      That curly braces is not needed to insert plaintext, it's used to insert JS code...(just saying)

  • @penyoutube8584
    @penyoutube8584 5 лет назад +5

    @traversyMedia, Please next time when you make a tutorial name the properties and the classes/components differently. I had to pause so many times just because I could not understand which "todo" you were talking about.
    You could use "todo" for the component and "todoProp" for the property, at least that way I can keep track of which thing you are talking about.

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

      Second this. I love his tutorials, but this one was very difficult to understand with everything being called "todo".

  • @jayw7257
    @jayw7257 4 года назад +5

    Take out the trash
    Meeting with Boss
    Dinner with Wife
    Can't you just combine those last two into one task? Maybe give it a className="Danger" ?

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

    Can someone maybe explain to me why when i create the react project using the tool for some reason it creates it with functions and not classes, I looked at the part of creation and it just seems the same, checked online couldnt find anything tried the change log no great change.
    would love some help tnx

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

    It will be great if you upgrade the video with the latest version because when the app created I can see function but in your video, it is still showing class. which will be quite confusing for the freshers.
    It's just a kind of suggestion from my side.

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

      24 minutes in and I’m stuck I think for that reason. Getting “state is not defined” error maybe from putting a state in a function?? I dunno...

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

    pro tip: speed up the video(most educational videos) to 1.25X , it makes the videos faster so you can watch more videos in a session.
    this video was extremely helpful!

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

    great course and explanation, love it.
    For those of you having issues with importing the Router just do:
    npm install react-router-dom --save-dev

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

    Love this video, such a great tutorial that explains things so well!
    But I wonder what his wife did when she saw that dinner with her was on a todo list 😆

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

    I was able to auto complete HTML tags such as and in JS file after completing this process.
    go to preferences > settings > Extensions > Emmet > Include Languages>
    1) Add Item
    2) Item: javascript
    Value: javascriptreact
    ------- OR-----
    in your settings.json
    Add in >>
    "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    }
    =)

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

    for anybody who runs in to the uuid "problem" you need to import {v4 as uuidv4 } from "uuid" and then use uuidv4() in the code instead. More info here: www.npmjs.com/package/uuid

  • @madhousenetwork
    @madhousenetwork 5 лет назад +29

    1.25x speed is perfect!

  • @zharriott2010
    @zharriott2010 5 лет назад +7

    Appreciate you putting these tutorials together. These are too helpful ✊🏽

  • @Ash-em5pm
    @Ash-em5pm 5 лет назад +5

    Coming from Angular , React seems so easy

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

    Hey Brad, i normally dont comment on videos. But i gotta say thank you for making this awesome tutorials! I bought your MERN udemy course, but decided to take a look at your crash courses and they are SPLENDID! I am currently changin careers from the medical field, and your videos inspire me to push through the grind. Thank you!

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

    am i the only one who watches this for like hmmm 5th time and still dont know shet?