React is just not about useState👀
My App.jsx had become a mess — multiple useEffects, auth checks, socket connections, loading states… everything in one place. It worked, but reading it felt like debugging a jungle 😅
That’s when it hit me — this is exactly where custom hooks shine.
Instead of stuffing all logic inside components, we can extract it into reusable hooks like:
useAuth() → handles user + login state
useSocket() → manages connection & events
useLoading() → controls loaders
Basically turning this 👇
👉 one giant useEffect
into this 👇
👉 clean, readable, modular logic
What I love about custom hooks is:
They clean up components
They remove duplication
And they make your code feel more like building blocks than chaos
Also an underrated point:
👉 Custom hooks don’t share state, they just share logic. (React)
That means every component still stays independent, which is exactly what we want.
Still learning, but this small shift already made my code 10x better.
If you’re writing long useEffects…
that’s probably your signal to create a hook ⚡
#ReactJS #FrontendDevelopment #WebDevelopment #CodingJourney #JavaScript
So true! Many people immediately jump to memoization instead of engineering their state. What's worse, the new React compiler allows you to create a mess because they add memoization here and there under the hood. What if there was a framework that makes you write good state management by design? Take a look at Inglorious Web and let me know what you think! https://npmjs.com/package/@inglorious/web