I have worked on many React codebases during my career. But one of them stands out from the rest. It was truly horrible to work with.
Now I know from experience that most codebases seem horrible when you first take a look at them. Usually, this feeling subsides. But that did not happen here.
From what I have heard and seen, it seems that the project was built by a developer who didn't have much experience with React or frontend development and they made a series of bad decisions. Eventually, the company found out about the true state of the codebase as it hogged all the resources and they brought me on board to try and mend it.
I think a lot can be learned from this codebase. So over the next few months, I will go over some of the horrible stuff I found on that codebase and how I tried to mitigate it. The solutions I came up with are probably not perfect but I think they were an improvement.
Since this is a real codebase, I can't disclose much information about it. But I can say that it is a Next.js web app with tens of thousands of users every month. Yes, Next.js is not the same as a React SPA but I think most of the issues I found are also relevant to React SPAs so I will call this series "Lessons from a bad React codebase".
You can sign up using your e-mail below to not miss any posts in this series!