When I started learning React, I came across something called useState().
At first, I only knew how to use it.
For example:
const [count, setCount] = useState(0); Click a button, increase the count, and React updates the screen.
Pretty simple, right?
But then I started wondering...
What actually happens when I call setCount()?
I learned that React doesn't reload the entire webpage.
Instead, something interesting happens:
React receives the state update.
The component runs again with the new state.
React compares the previous UI with the new UI.
It updates the necessary parts of the actual DOM.
For example, if only the counter value changes, React doesn't need to recreate the entire page.
That made me understand one important thing:
Learning React isn't just about knowing components, props, and hooks.
It's also about understanding what React does behind the scenes.
I'm still exploring these concepts, and honestly, every small discovery makes React more interesting.