Articles

How a “Useless” Tip Saved Ben's Sanity in Production

Kent C. Dodds
Kent C. Dodds

Every so often, I hear from learners who've had one of those "wait a minute…" moments where something that seemed obscure in the workshop suddenly becomes the perfect tool for the job. Ben from Cheltenham sent me one of those stories, and with his permission, I'm sharing it here (completely unedited). It’s a perfect example of how subtle lessons from Epic React can shape your long-term intuition as a React developer.


Hey Kent (&team)!

I wanted to share a quick AHA moment that perfectly captures why your courses are so valuable to me.

The Setup: I did (some of) Epic React a while back, and in the fundamentals workshop you covered resetting component state with the key prop. You said: "So there you go, that is using the key prop to reset an element, you can put this on an entire chunk of your UI, however you want to do that, and that can reset that entire chunk of UI, again, not something you do a ton, but absolutely something you do sometimes, so just put this in the back of your mind to think on in the future as a mechanism for resetting the state of, or your UI for a particular area, because it can be useful sometimes. Great job!"

And honestly, my first thought was "lol, when would I ever need this? I've been coding React for 5 years and can't think of a single time I've needed it."

The Payoff: Months later, I'm at work dealing with a React Native text input that has stale state when users navigate between animals in our livestock management app.

I could fix it in the event handler, but that would mean updating multiple handlers and adding tons of complexity to what's already a massive feature drowning in tech debt - and we definitely don't need any more complexity, thank you very much! I also considered useEffect, but it felt like the wrong tool for the job.

I brainstormed with Claude, explored different approaches, and then - boom - "Wait, didn't Kent mention something about this in that workshop ages ago?"

One line change: <AnimalActionForm key={currentAnimal?.id} session={session} />

Problem solved. Perfectly clean. No complexity added.

The Real Value: But here's the deeper insight: In the past, I probably did encounter situations like this - I just solved them poorly because I didn't know better options existed. I would have gone straight to useEffect thinking "this is fine" without even considering alternatives.

Your courses don't just give me more tools - they expand my mental model of what's possible. Now when I see a useEffect synchronising local state like this, something feels off. I think "wait, this does not feel right. There must be a cleaner way." instead of just accepting it as the only solution. And the funny thing is that the solution can be incredibly banal (like in this case).

It's like you're training my developer intuition to recognise code smells I didn't even know were smells before. The techniques are valuable, but the shifted perspective on what constitutes "good" vs "fine" code is even more valuable.

The Point: This is exactly why your courses are so good. I have similar experiences so far from going through Epic Web. Even when I don't work in Remix, Epic Web gives me a reference for what good code looks like, what problems well-designed applications should solve, tips and tricks that seem "academic" at the time but turn out to be gold later.

I always forget to write down these moments, but this one was too perfect not to share. Your "useless" key example saved me from some really gnarly production code. Thanks for teaching the stuff that seems unnecessary until it's exactly what you need!

Have a great weekend! 🚀

Kind regards Ben (from Cheltenham, UK)


Thanks again to Ben for taking the time to share this moment. If you’ve had a similar “aha!” from Epic React, Epic Web, Epic AI, etc., I’d love to hear from you. Sometimes the most “banal” tricks end up being the most powerful ones in your toolbox.

Get my free 7-part email course on React!

Delivered straight to your inbox.