Reactive programming keeps interface parts that depend on data predictably updated when that data changes. Its basic flow is user input, state updates, derived-data computation, and effects such as rendering the DOM. section 13.1
user event → update state → compute derived data → update the DOM
Follow the data through the reactive flow, from a user event to state, derived data, and the DOM. section 13.1
Reactivity is not exclusive to frameworks, but the browser does not automatically track arbitrary data changes. Vanilla JavaScript uses browser primitives to build explicit bindings and updates; choose the smallest pattern that fits the page. section 13.2 section 7.4
Vanilla approaches trade explicitness for convenience:
- Start with direct DOM bindings or data-* bindings; these are enough for many real apps. section 13.2
- For other needs, consider template strings, <template> cloning, EventTarget stores, Proxy wrappers, or signals. section 13.2
- Keep both directions visible: render state into the DOM, and use input or change events to write user actions back into state. section 13.2
Custom Elements do not provide built-in reactivity, so property changes may require extra code to update the DOM. Project-specific reactive UI can also be cumbersome with components alone. section 7.4







