๐ฏ 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.