Minimal React hello world example. As you click:
  • one counter increments every time
  • the other increments every two clicks
By opening a web inspector, you can see that only modified elements get updated. So we understand that JSX parses its "HTML-like" into a tree, and then propagates updates on that tree.
By looking at the terminal, we see that render() does get called every time the button is clicked, so the tree of elements does get recreated every time. But then React diffes thing out and only updates things in the DOM where needed.

Articles by others on the same topic (0)

There are currently no matching articles.