React is a JavaScript library for building user interfaces, started at Meta and now used across the industry. It is not a programming language, not a database, and not a replacement for HTML and CSS. You still write JavaScript; React gives you a way to split the UI into components that update when data changes.
The problem it solves
With only the DOM APIs (document.querySelector, innerHTML), a todo list or a dashboard quickly becomes a tangle of event listeners that forget to update some part of the page. React’s model is: UI = function(state). You describe what the screen should look like for the current data; React updates the DOM to match.
Core ideas (accurate, not slogans)
- Components — functions that return markup (JSX). A button, a navbar, a whole page can each be a component.
- State — data that belongs to a component and can change (the text in an input, whether a modal is open).
- Props — data passed from a parent component into a child (like function arguments).
- Reconciliation — React compares the previous tree of elements with the next one and changes only what it must in the real DOM. People call the in-memory tree the “virtual DOM.” You do not write to the DOM yourself for normal UI.
When you do not need React
A college portfolio, a static notes page, or a GPA calculator like the one on this site can be HTML, CSS and a little JavaScript. React pays off when the UI has lots of interactive state, lists that change, or a team that wants reusable components. Jumping to React before you can use the DOM and fetch makes debugging harder, not easier.
Next: install a real toolchain with Vite — Create React App is retired.