C
ChaoBro

React Doctor: When AI Starts "Diagnosing" Your React Code

React Doctor: When AI Starts "Diagnosing" Your React Code

"Your Agent Is Writing Bad Code, This Tool Catches It"

React Doctor's README has a bold statement: "Your agent writes bad React. This catches it."

It might not sound pleasant, but it hits a pain point that almost every frontend developer has in 2026.

Since AI programming tools like Cursor, Copilot, and Codex became widespread, the production speed of frontend code has multiplied several times over. But with speed increasing, what about quality?

A Tool Born from Real-World Practice

React Doctor was created by Aiden Bai — the founder of Million.js. This isn't your typical project maintainer; he's an engineer with an almost obsessive pursuit of React performance optimization.

Million.js itself is a virtual DOM alternative that markets itself as "70% faster than React." So when he says "AI-written React code has problems," you should listen carefully.

What's even more noteworthy is the recent update frequency — PRs were being merged just 2 hours ago, fixing false positives and improving the scoring algorithm. This shows it's not just a proof of concept, but a seriously built, usable tool.

What Does It Actually Check?

React Doctor isn't a generic linter. It focuses on those "looks like it works but is actually a trap" patterns common in AI-generated code:

  • Unnecessary re-renders: AI often generates components missing memo and useMemo, functionally fine but a performance disaster
  • Wrong data fetching patterns: Directly calling APIs in render, missing error handling, no loading states
  • Overly complex component structures: AI tends to pile logic into a single component rather than splitting it
  • Code that violates React best practices: Like directly mutating state instead of using setState

Its checking logic isn't simple AST matching — it combines semantic analysis, understanding "this code is syntactically correct but will cause problems at runtime."

GitHub Action Integration Is the Killer Feature

The smartest design in React Doctor is making it a GitHub Action.

You don't need to run it manually — it automatically runs on every PR submission, scoring your code quality and listing specific issues. This means:

  1. AI-generated code gets automatically reviewed, no need for manual line-by-line inspection
  2. Teams can set quality thresholds, automatically rejecting PRs below the threshold
  3. Issues appear directly in the PR, developers can see them right in the code review interface

This workflow design fits very well with real team development scenarios.

A Leaderboard Sparks Competition

React Doctor recently added a Leaderboard feature — ranking different AI coding tools by code quality.

This might look like a small feature, but its significance may be greater than the tool itself. Because it creates a public comparison dimension: no longer about who has more features or faster response times, but "who writes better quality code."

If this competitive dimension takes hold, it will push AI coding tool vendors to focus on code quality, not just stack up feature counts.

My Concerns

React Doctor's approach is great, but there's a fundamental question: who defines "good code"?

Aiden Bai's understanding of React performance is undoubtedly top-tier, but his standards don't necessarily fit every team or every project. In some scenarios, readability matters more than performance; in others, development speed matters more than code quality.

React Doctor needs to avoid becoming a "there's only one right way" tool. Fortunately, from recent updates, the team is actively reducing false positive rates and accepting user feedback — that's a good sign.


If you're using AI tools to write React code, React Doctor deserves a place in your CI pipeline. It won't replace manual code review, but it can catch those pieces of code that "AI thought were fine but actually aren't."