🧵 I stopped building my e-commerce UI with static HTML… and rebuilt...

Static HTML for product info, images, cart, and layout.
It was fast.
It was clean.
It worked.
I could’ve finished the project quickly.
Instead of hard-coded UI, I started rendering everything with JavaScript.
No more static content.
Everything became data-driven.
Product info → JS
Gallery → JS
Cart → JS
UI state → JS
- product object (name, price, images, thumbnails)
- state object (current image, quantity, cart)
Now the UI was no longer “written in HTML”…
It was “generated from state”.
Cleaner. More controlled. More scalable.
I stopped thinking:
"Which element do I update?"
And started thinking:
"What does the state look like right now?"
That's a completely different way of building UIs.
- renderProductInfo()
- renderThumbnails()
- renderCart()
+ updateQuantityDisplay()
Each function responsible for syncing UI with state.
Everything became explicit and intentional.
Speed dropped.
A LOT.
Because now I wasn't just building UI…
I was designing how UI behaves.
Every feature required:
state → update → render → sync → test
Static HTML teaches structure.
JavaScript rendering teaches architecture.
I wasn't just building a page anymore.
I was building a system.
I accidentally started thinking like React.
🔹state-driven UI
🔹render functions
🔹DOM as output, not source of truth
🔹components emerging naturally
I didn't plan that but it's happening.
This shift slowed me down, yes.
But it also changed how I see frontend development entirely.
I'm no longer just placing elements on a page…
I'm designing how UI reacts to state.
That's where the real insight will come from. 💡


