> For the complete documentation index, see [llms.txt](https://isubasinghe.gitbook.io/isithas-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isubasinghe.gitbook.io/isithas-wiki/software_engineering/frameworks/react.md).

# react

## Basic idea

A declarative JavaScript UI library: describe the UI as a function of state; React diffs the resulting virtual DOM against the previous one and applies the minimal real-DOM patches.

## Key facts

* Components: functions returning JSX (sugar for `React.createElement`).
* State: `useState`, `useReducer`; side effects: `useEffect`.
* Reconciliation via virtual DOM; keys identify list items across renders.
* Unidirectional data flow (props down, events up).
