Hacker News new | ask | show | jobs
Reducing Bloated React Code
2 points by cruxcode 1162 days ago
What do you find in a bulky web app code? 1. Less component reuse 2. Un-generalized way to write React components. 3. Data manipulation logic that could be handled in backend.

Developers have a tendency to write React code first and then put them in a React component later.

Developers don't have a fixed pattern of writing components. They decide prop signature randomly. This leads to other problems, such as, it's hard to generalize other pieces of code such as store update/read etc.

Writing data manipulation logic in the frontend has become very common problem. The client side frameworks have imparted this bad habbit in new gen developers.

Please share the best practices/rules you follow to keep the bundle size & code smaller.