Virtual DOM
Definition
An in-memory representation of the real DOM that React uses to optimize updates. When state changes, React creates a new virtual DOM tree, diffs it against the previous one, and applies only the minimum necessary changes to the real DOM.
Code Example
Learn More
Related Terms
Document Object Model — a tree-structured representation of an HTML document that allows JavaScript to read and manipulate page content, structure, and styles. Every HTML element becomes a node in the DOM tree.
ComponentA reusable, self-contained piece of UI in React. Components accept inputs (props) and return JSX describing what should appear on screen. Can be functions (recommended) or classes.
StateData that a component manages internally and can change over time. When state updates, React re-renders the component. Use useState for simple state and useReducer for complex state logic.