LESSON 01 / 05

Why React?

React lets you build interfaces from small, reusable components that update automatically when your data changes.

๐ŸŽ“Mediumlevel
โฑ๏ธ25 minto finish
โœ๏ธ1activities

๐Ÿ“‚ Components & JSX๐Ÿท๏ธ React

๐ŸŽฏ By the end of this lesson you canโ€ฆ

  • Explain the problem React solves
  • Describe components and declarative UI
  • Render your first component

In plain JavaScript you told the page how to change step by step (“find the span, set its text, add a classโ€ฆ”). In React you say what it should look like for the current data, and React works out the changes. Thatโ€™s called declarative UI.

โš›๏ธ React App.jsx ๐Ÿ‘† Tap a line to explain it
1function App() {2  return <h1>Hello, React! โš›๏ธ</h1>;3}

Press ๐Ÿ‘ Preview. Then press โœ๏ธ Edit and change the text โ€” the preview updates as you type.

๐Ÿ’ก Concept check
What is a React component?

๐Ÿ“Œ Key takeaways

  • You describe what the UI should look like for the current data; React updates the page.
  • A component is a function that returns UI.
  • React is used by Meta, Netflix, Airbnb and thousands of companies.

Finished reading & practising?

Saved in this browser. Create a free account to keep it forever.