15
My first React project was a total mess 6 weeks ago
I started building a simple to-do app and my code was 400 lines of spaghetti in one file with no structure. After I finally learned about components and state management, I rewrote it in 2 days with maybe 80 lines total. Did anyone else hit a wall like this before things clicked?
2 comments
Log in to join the discussion
Log In2 Comments
piper17522d ago
400 lines for a to-do app is wild but I've been there. First time I tried React I had everything in one giant function with setState calls everywhere. Took me a solid month of watching videos and reading docs before I actually got how components split things up. Once you understand props and lifting state up it's like a light switch flips. Now I can't imagine writing frontend code any other way.
3
price.alice22d ago
Oh man, that first giant function phase is the worst isn't it? I remember staring at my screen for hours trying to figure out why clicking one button was breaking three other things. The light switch moment you described is so real though - once components actually clicked for me, I felt stupid for struggling so long. The hardest part for me was unlearning everything I thought I knew about writing code. Now I get how props and state flow through an app and it feels obvious, but getting there took way longer than I expected. Looking back, I think that messy 400-line to-do app was actually a necessary evil.
8