React JS - React Tutorial for Beginners

Programming with Mosh · 6.4M views · 2018 · 2:25:27

Open on YouTube

Web developmenttutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when pointing newcomers to a full React beginner course, and many askers cite it as the tutorial whose code they are following when they hit errors.

Recommended by 9 people across 8 different months, 2018 to 2024.

What it is

A 2018 beginner React tutorial by Mosh Hamedani that runs about two and a half hours. It starts from setup with create-react-app and covers components, JSX, props and state, event handling, lists, conditional rendering, and lifting state up by building a counters app.

What people said

Recommends Chris · 2018-12 · Stack Overflow · on “How can I compile a ReactJS application (files) into one index.html file?”

I'm in the process of utilizing ReactJS (JSX) within a microsoft sharepoint static website. This website cannot compile JSX code. As a result, I need to convert my reactjs code/package/app into one simple file that should contain all the code and the dependencies as CDNs: index.html I've followed the following steps of implementing ReactJS (based on this Youtube video [this video] ) Download NodeJS [LINK] Install create-react-app package: sudo npm i -g create-react-app Create React Application create-react-app react-app After completing my application, my file/directory structure is as follows: [LINK] How can I compile this entire application into one simple compiled index.html file that I can ut

Recommends Nick · 2019-02 · Stack Overflow · on “React JS setState behaviour”

I was following this tutorial [this video] , And on 1:10:18 (timestep included in link) he wrote this.setState({ count: this.state.count + 1 }); (where count is a primitive value inside state object, that is then displayed on page after button click) From tutors words i understood that we need to specify count: inside setState so that React will update this value in state object. But i noticed that i can just write some bullshit in setState like: handleIncrement = key => { this.state.totalCount += 1; this.state.tags[key] += 1; this.setState({ countBlabla: 23213123 }); }; And HTML still will be updated correctly, without re-rendering everything. (I've checked in developer tools, only values that w

Recommends Mariano L · 2019-10 · Stack Overflow · on “From OOP to ReactJs: Why I should remove the local State from a Component and move it to their Parent?”

I would say that I have good experience with a lot of OOP languages. Most with Java. I've made full stack development with Spring boot and now i'm trying to learn React. My point with all this is that maybe I'm to used to OOP languages so there are some "design philosophies" that I cannot understand. I've started with this tutorial video: [this video] It's pretty great and clear but I have an issue in one part in particular: 1:47:55 Removing the Local State To summarize the video, he makes an component called Counters that contains N componentes called Counter. This component Counter is just one number and a button that every time is pressed the value should increments by 1. Originally, this valu

Recommends himayan · 2020-07 · Stack Overflow · on “Props in other component is undefined React”

No problem. If you find it helpful, do upvote. Also, you can refer this youtube video [this video] . It will help you understand React concepts better.

Recommends Eliav Louski · 2020-07 · Stack Overflow · on “Grabbing the value of a form input method for a possible arithmetic operation in ReactJS”

as I already told, you should maintain the state (the data you need) in order to render properly what you need. do not store jsx elements in your state. the second change(`handleCourseChange `), I pass id because you need to know what element in the array in the state you need changing. this is all I changed. you are probably very new to React so I would recommend you learn from scratch. youtube tutorial is probably a good place to start. I would recommand this [this video] . if my answer solved your problem please accept it as an answer and thumb up ;)

Recommends Prateek Thapa · 2020-09 · Stack Overflow · on “React create a reusable Modal”

Okay. You need to learn the basics of `React` before starting. I recommend watching this [this video] . You're way off on implementation and the foundations on React. Invest your time in that video, and later if you have any problem, feel free to post.

Recommends alisasani · 2021-02 · Stack Overflow · on “Loop through json object and display the data with React?”

Well, in my opinion, the documentation of react is the best resource as they have written it very informative and simple. I also found videos of Mosh on youtube ( [this video] ) useful and simple when I started learning about it.

Recommends Hyror Hakeith · 2021-06 · Stack Overflow · on “the argument on on click function is not defined in react”

hey so i have trying to watch some tutorial, but i have encountered a problem, handleIncrement = (product) => { console.log(product); this.setState({ count: this.state.count + 1 }); }; render() { return ( <React.Fragment> <img src={this.state.imageUrl} alt="" /> <span style={this.styles} className={this.getBadgeClasses()}> {this.formatCount()} </span> <button onClick={() => this.handleIncrement(product)} className="btn btn-secondary btn-sm" > Increment </button> {this.state.tags.length === 0 && "Please create a new tag"} {this.renderTags()} </React.Fragment> ); } the product on onClick function in the render section is not defined, but the tutorial i follow on youtube when he write this code

Recommends Mashaim Tahir · 2022-04 · Stack Overflow · on “Can functional component prop be modified?”

You cannot modify any props rather it can be handle by event handling to change the state. See this video from the current time duration. After this you know about the event handling and binding. [this video]

Cites Amir · 2018-10 · Stack Overflow · on “problem with VSCode IDE for writing react code”

I just start to write some codes in react in VScode but after creating a default project by " create-react-project [LINK] " based on the Mosh tutorial [this video] . I have some warning by VS code when I open APP.JS as shown below. would you mind tell me why I am receiving these warning? I am confused about what is right and what is wrong in my code. [LINK]