Skip to main content

2 posts tagged with "backend-to-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.