Modularizing React Applications: fixing Shotgun Surgery

This post was originally published on this site

Martin Fowler

While I’ve put React application, there isn’t such a thing as React application. I mean, there are front-end applications written in JavaScript or TypeScript that happen to use React as their views. However, I think it’s not fair to call them React applications, just as we wouldn’t call a Java EE application JSP application.

More often than not, people squeeze different things into React components or hooks to make the application work. This type of less-organised structure isn’t a problem if the application is small or mostly without much business logic. However, as more business logic shifted to front-end in many cases, this everything-in-component shows problems. To be more specific, the effort of understanding such type of code is relatively high, as well as the increased risk to code modification.

In this article, I would like to discuss a few patterns and techniques you can use to reshape your

To read the full article click on the 'post' link at the top.