--- { title: "What is Reactivity?", description: "When researching frontend frameworks, you're likely to hear about \"reactivity\". But what is it? Why does it matter? Let's explore this and more in this article.", published: '2023-12-14T21:52:59.284Z', authors: ['crutchcorn'], tags: ['react', 'vue', 'angular', 'webdev'], attached: [], license: 'cc-by-4', collection: "react-beyond-the-render", order: 1 } --- > This article is intended for newcomers to HTML and JavaScript programming. However, it's suggested that you read [this article explaining what the DOM is](/posts/understanding-the-dom) first. As an experienced frontend engineer, I'm often asked: > "Why would you want to use a modern frontend framework like React, Angular, or Vue?" While [I have a whole (free) book on the topic](https://framework.guide), my short answer is typically "Reactivity". The follow-up response I usually get from this is: > "What is reactivity?" In short, **Reactivity is the ability to reflect what's in your JavaScript application's memory on the DOM as HTML**. See, when you're building a website using only static HTML, the output to the DOM is straightforward. ```html

Text here

``` ![A chart showing the document object model layout of the above code. It shows that the 'main' tag is the parent to a 'ul' tag, and so on](../understanding-the-dom/dom_tree.svg) The problems start when we want to introduce interactivity into our output. Let's build a small-scale application that: - Has a button with a counter inside of it - Start the counter at `0` - Every time the button is clicked, add one to the counter ![A 'main' tag that has a button child. This button updates a JavaScript count when pressed and when that value is updated, will change the text of the button](./step_1.svg) To do this, let's start with some HTML: ```html
``` Then we can add in the required JavaScript to make the button functional: ```html ``` # Adding a List Not too bad, let's increase the difficulty a bit by: - Adding an unordered list (`