React
React is an open-source JavaScript library for building user interfaces, created and maintained by Meta (Facebook). It is built on the idea of reusable components and a declarative description of the interface, where the developer states what the view should look like for a given data state and React handles updating the screen efficiently. It is one of the most popular front-end technologies in the world.
How React works
React rests on several key mechanisms:
- Components — the interface is split into independent, nestable blocks (buttons, forms, lists) that can be reused in many places.
- JSX — a syntax that blends JavaScript with an HTML-like notation, letting you describe the view structure directly in a component's code.
- Virtual DOM — React keeps a lightweight copy of the DOM tree in memory, compares it after each state change and updates only the parts of the page that actually changed.
- Hooks — functions like useState and useEffect let you manage state and side effects in function components.
Thanks to a one-way data flow, React apps are predictable and easier to debug.
React in practice
React shines when building modern, interactive interfaces:
- Single-page applications — it is a natural choice for building a SPA, where content changes without a full page reload.
- Server-side rendering — frameworks built on React (e.g. Next.js) add SSR, routing and performance optimizations.
- Mobile apps — React Native lets you build native iOS and Android apps using the same component logic.
In the front-end ecosystem, React competes with Vue.js and Angular; the technology choice depends on project scale, team skills and performance requirements.
Powiązane pojęcia
Najczęstsze pytania
Is React a framework or a library?
Technically, React is a library focused on the view (UI) layer. Unlike full frameworks such as Angular, it does not impose routing or state management — those are added with separate packages (e.g. React Router). In practice, the whole ecosystem around React is sometimes called a framework.
How does React differ from Vue.js?
Both build component-based interfaces on a virtual DOM. React leans on JSX and more freedom (fewer imposed conventions), while Vue offers a more integrated, beginner-friendly toolset. The choice depends on team preference and project scale.
