Skip to main content

7 posts tagged with "frontend"

View All Tags

Why Can't I Just Use Regular Variables? Understanding useState's Magic

· 13 min read
Mahmut Salman
Software Developer

I'm a backend developer learning React, and I'm confused. Why do I need useState when I can just create my own setEmail function like we do in Java? 🤔 Just set the variable and done! My frontend mentor showed me what happens when you try this—and why React's useState is actually solving a critical problem I didn't even know existed. This conversation revealed the beautiful machinery working behind React's scenes.

Wait, Does 'await' Make My Code Synchronous? Understanding Async/Await's Double Nature

· 12 min read
Mahmut Salman
Software Developer

I'm a backend developer learning frontend, and I just encountered something confusing. I use await login({ email, password }) and my code waits for the response before continuing—isn't that synchronous? 🤔 But the method is marked async, so it's asynchronous? My frontend mentor explained the beautiful double nature of async/await: it makes code look synchronous inside the function but stay asynchronous to the outside world. This conversation finally made async/await click for me.

I Only Added w-full, Why Is My Button Text Centered? Understanding Browser Defaults

· 11 min read
Mahmut Salman
Software Developer

I'm learning frontend development, and something weird just happened. I added only w-full to my button, and the text "Click me" became centered horizontally! 🤔 I didn't add any text-centering classes. My frontend mentor revealed something I never knew: browsers have default styles that help us without us even knowing. This conversation opened my eyes to the invisible CSS working behind the scenes.

Wait, Why Does My Width Stay 384px But Height Changes? Understanding the CSS Box Model

· 9 min read
Mahmut Salman
Software Developer

I'm a backend developer learning frontend, and I just noticed something weird in Firefox Inspector. I removed p-8 from my div, and the height changed from 124px to 60px—but the width stayed at 384px! 🤔 My frontend mentor explained the CSS Box Model and why w-96 behaves differently from h-auto. This conversation finally made the box model click for me.

Why Adding 'block' to My Label Changed Everything: Understanding CSS Display Property

· 11 min read
Mahmut Salman
Software Developer

I'm learning frontend after years of backend work, and I just discovered something fundamental that nobody explains clearly: the display property. I added block to my label, and suddenly my form inputs stacked vertically instead of sitting side-by-side. I had no idea what I just did. 🤯 My frontend mentor explained how block, inline, and inline-block are the foundation that flexbox and grid are built on. This conversation changed everything.

The Mystery of CSS Flexbox Centering: Why Merging Two Divs Breaks Everything

· 10 min read
Mahmut Salman
Software Developer

I'm a backend developer learning frontend, and I just spent 2 hours debugging why my centered login form moved to the left when I "simplified" my code. The CSS felt like black magic. 🎩✨ My frontend mentor showed me why two divs are NOT just redundant nesting—they're a fundamental pattern in CSS positioning. Let me share this conversation that changed how I think about layout.

From HTML Error Pages to Beautiful JSON: Fixing JWT Authentication Errors in Spring Boot

· 13 min read
Mahmut Salman
Software Developer

"Why is my API returning HTML error pages?!" I stared at my console in disbelief. My React frontend was trying to parse JSON, but Spring Security was happily serving up a Whitelabel Error Page for failed authentication attempts. This took me 3 hours to fix. Let me show you how to make Spring Security play nice with modern frontends. 🎨✨