# React
React is an open-source [[JavaScript]] library for building user interfaces, created by Meta (Facebook). Licensed under MIT. The most widely used front-end library in web development.
React uses a component-based architecture where UIs are composed of reusable, self-contained components. It introduced the virtual DOM for efficient rendering and a declarative programming model.
## Key concepts
- **Components**: Reusable UI building blocks (function components are the standard)
- **JSX**: Syntax extension mixing HTML-like markup with JavaScript
- **Hooks**: Functions for managing state (`useState`), side effects (`useEffect`), context (`useContext`), refs (`useRef`), and more
- **Virtual DOM**: In-memory representation of the UI for efficient diffing and updates
- **Unidirectional data flow**: Data flows down from parent to child via props
## React 19 (latest major)
- React Server Components (RSC): Components that render on the server, reducing client bundle size
- Server Actions: Functions that run on the server, callable from client components
- React Compiler: Automatic memoization (experimental)
- `use()` hook for reading resources (promises, context) during render
- Improved hydration error reporting
## Ecosystem
- **Frameworks**: [[Next.js]], Remix, Gatsby
- **State management**: [[Zustand]], Redux, Jotai, Recoil
- **Styling**: Tailwind CSS, styled-components, CSS Modules
- **Data fetching**: TanStack Query, SWR
- **Testing**: React Testing Library, Vitest, Jest
## References
- Website: https://react.dev
- Documentation: https://react.dev/learn
- Source code: https://github.com/facebook/react
## Related
- [[Next.js]]
- [[Zustand]]
- [[JavaScript]]
- [[TypeScript]]