React ยท Chapter 1 of 42

React Introduction

React is a JavaScript library for building user interfaces, created by Facebook (Meta). It lets you build reusable UI components and efficiently update the DOM when your data changes.

React is declarative: you describe what the UI should look like for a given state, and React handles updating the actual browser DOM for you.

Why React?

React makes it easy to build complex, interactive UIs by breaking them into small, reusable components. Its virtual DOM makes updates fast and efficient.

Where it's used

React powers Facebook, Instagram, Netflix, Airbnb and thousands of other sites. It can also build mobile apps via React Native.

Example 1 (jsx)
function App() {
  return <h1>Hello, React!</h1>;
}

export default App;
Output
Hello, React!

A minimal React component that renders a heading.

Key points

  • React is a JavaScript library for building UIs, made by Meta.
  • React uses a component-based, declarative approach.
  • A virtual DOM makes updates fast.
  • React can be used for web (React DOM) and mobile (React Native).
๐Ÿ’ก Note: React itself only handles the view layer โ€” routing, state management, etc. often come from other libraries.

๐Ÿ“ Quick Quiz

1. Who created React?

2. React's programming style is:

3. What does React use to make DOM updates efficient?