Minimal React hello world example. As you click: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.
- one counter increments every time
- the other increments every two clicks
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.Failed attempt at minimizing nodejs/next/ref-twice outside of Next.js.
Articles by others on the same topic
There are currently no matching articles.