React is a JavaScript library for building user interfaces out of small, reusable pieces called components. A component is a function that returns the interface to show for a given set of data. React keeps the visible page in sync with that data, so you describe what the screen should look like and React handles the updates.
The library was released by Facebook in 2013. Since February 2026 it is owned by the React Foundation, an independent foundation hosted by the Linux Foundation, with Meta as one of its members. The current stable release is React 19, documented at react.dev.
Here is a tiny React component:
function Greeting({ name }) {
return <h1>Hello, {name}</h1>;
}This component returns JSX, a JavaScript syntax extension that looks like HTML. Given a name value of Maya, React renders a heading that says "Hello, Maya."
The important idea is that the component does not build the heading by hand. It describes the result, and React creates the matching DOM element for you.
What React is
React is a library, not a full framework. It focuses on one job: rendering a user interface and updating it when data changes. Routing, data fetching, and forms come from additional libraries or from a framework built on top of React.
Three ideas sit at the center of the library:
- Components split an interface into independent, reusable pieces.
- State is data that changes over time and triggers a re-render when it updates.
- JSX describes the interface with syntax that looks like HTML.
Because React only handles the view, you can adopt it gradually. You can start with one interactive widget on an existing page and grow from there.
When to use React
React is a strong fit when an interface must stay in sync with changing data. A live dashboard, a chat window, or a shopping cart all benefit from React's model: update the data and React updates the screen.
React also pays off when the same interface appears in many places. A product card used on a home page, a search page, and a category page is one component you write once and reuse.
Signs that React is a good choice:
- The page has lots of interactivity, such as forms, filters, or live updates.
- Parts of the interface repeat with different data.
- The app will grow into a single-page application with multiple views.
- A team wants to share UI code across web and mobile.
If you decide to move forward, creating a React app with Vite is the fastest way to get a project running locally.
When React is not the right fit
React is not always the best tool. A marketing page, a blog post, or a documentation site with mostly static content works fine with plain HTML and a little JavaScript.
Using React adds a build step and ships a JavaScript runtime to the browser. If the page does not need interactive, data-driven UI, that overhead brings no benefit.
React is also the wrong starting point if you are still learning the language itself. React is JavaScript, so a solid grasp of functions, arrays, objects, and modules comes first.
How React updates the interface
React does not write to the page directly on every change. It keeps a lightweight in-memory description of the interface, compares it with the previous version, and commits only the changes that are needed. This process is called reconciliation, and it is covered in the guide on the React Virtual DOM and reconciliation.
The benefit is that you write components as plain functions that return a description of the UI. You do not manually find elements and edit their text.
The guide on React versus JavaScript builds the same counter both ways, so you can see exactly what the library removes from your code.
What to learn next
Start with the guide on creating a React app with Vite, then read the React project structure guide to understand every file in a fresh project. From there, move on to JSX and your first component.
Rune AI
Key Insights
- React is a JavaScript library for building user interfaces from components.
- Components are functions that return the UI for a given set of data.
- React updates the page declaratively when data changes.
- Use React for interactive, stateful, or reusable interfaces.
- Plain HTML is fine for mostly static pages.
Frequently Asked Questions
Is React a framework or a library?
What is React used for?
Do I need to know JavaScript before learning React?
Conclusion
React is a JavaScript library for building interfaces from reusable components. Choose it when an interface is interactive, stateful, or repeated in many places, and reach for plain HTML or a static site generator when the page is mostly fixed content.
More in this topic
How to Build a Dropdown Menu in React
Build a React dropdown menu with the ARIA menu button pattern. Handle open and close, keyboard arrows, and clicks outside the menu.
How to Animate React Components with Motion
Animate React components with the Motion library. Set up motion, add enter, hover, and exit animations, and respect reduced motion.
Headless UI Components Explained: Logic Without Locked Styling
Understand headless UI components and how libraries like Radix give you unstyled, accessible behavior that you style yourself.