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 r…


This content originally appeared on DEV Community and was authored by Usman Butt

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.


This content originally appeared on DEV Community and was authored by Usman Butt


Print Share Comment Cite Upload Translate Updates
APA

Usman Butt | Sciencx (2025-07-25T18:59:27+00:00) Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState. Retrieved from https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/

MLA
" » Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState." Usman Butt | Sciencx - Friday July 25, 2025, https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/
HARVARD
Usman Butt | Sciencx Friday July 25, 2025 » Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState., viewed ,<https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/>
VANCOUVER
Usman Butt | Sciencx - » Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/
CHICAGO
" » Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState." Usman Butt | Sciencx - Accessed . https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/
IEEE
" » Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState." Usman Butt | Sciencx [Online]. Available: https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/. [Accessed: ]
rf:citation
» Day 3 of My React Journey: Why Hooks Exist + Built a Counter App with useState | Usman Butt | Sciencx | https://www.scien.cx/2025/07/25/day-3-of-my-react-journey-why-hooks-exist-built-a-counter-app-with-usestate/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.