React in 60 Seconds

Rodrigo Pombo
InstructorRodrigo Pombo

Share this video with your friends

Send Tweet
Published 5 months ago
Updated 5 months ago

Learn React fast. This is a quick overview of how to use React core features compressed into one minute. Remember to pause the video if you need time to understand something!

This lesson is for React v16.8 or later.

To learn more about React and the rest of the features we haven't covered, visit the official website.

Rodrigo Pombo: [0:01] React provides a createDocument() function to declare what we want to render to the DOM. Instead of using createElement directly, you can use JSX. To create a component, you only need to write a function with a name that starts with a capital letter. Now, you can use that function in JSX.

[0:16] You can assign attributes and React will pass them to the component as parameters. Inside JSX, you use curly braces to wrap dynamic data. In fact, you can wrap any JavaScript expression. To add event listeners, you pass a function to the corresponding attribute.

[0:32] To add a state to a component, there's the useState() function from React. It gives you a function to update the state. When you call it, React will know it needs to re-render the component. To render a list, you can map each list item to an element using JavaScript.

[0:49] React only needs a unique key for each element to find out when something changes. If you want to compose components together, React passes the nested elements inside a special property called children.