top | item 45449702

Show HN: Tool that splits your Big React component into clean subcomponents

2 points| NabilChiheb | 5 months ago |npmjs.com

A client once sent me a React project where a single component was 1,800 lines long. It came out of an LLM code generator, and it was basically unmaintainable.

That pain led me to build React Code Splitter an open-source CLI that takes those monster files and helps you break them down into smaller, meaningful components. It uses ASTs under the hood, detects props automatically, and has an interactive mode so you can actually name things properly:

? Extract this component? Yes ? Component name: PaymentSummary

If you’ve ever opened a huge React file and thought “no human should have to read this”, this tool might help.

https://github.com/chihebnabil/react-code-splitter

discuss

order

No comments yet.