DEV Community

Usman Butt
Usman Butt

Posted on

Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState

In vanilla JavaScript, if you want to update something in the UI, you usually:
Use document.querySelector()

Then innerText or innerHTML to manually update each element

But in React, you just use useState() once β€” and React automatically updates all relevant parts of the UI where that state is used. It’s clean, declarative, and magical.

Top comments (0)