# React Doctor scored my site 52: every finding is a hypothesis

> React Doctor scored my site 52/100. I left almost half the findings unfixed: a finding is a hypothesis, and the suggested fix is sometimes harmful.

Source: https://omergulcicek.com/en/blog/react-doctor-findings-are-hypotheses

[React Doctor](https://github.com/millionco/react-doctor) is a tool that scans React code and reports issues in state, effects, performance, architecture, security and accessibility.[^rd-readme] There's nothing to install; you run `npx react-doctor@latest` from your project folder.[^rd-readme]

I ran it on my own site. The result: 52 out of 100, labeled "Critical". It found 29 issues across 344 files: 12 errors and 17 warnings.

After the fixes, the score went up to 76 with no errors left. But the score wasn't the real lesson. I left almost half of the findings unfixed, because fixing them was either unnecessary or harmful.

![The score goes from 52 to 76; fixed findings on the left, findings that were questioned and kept on the right](https://omergulcicek.com/blog/2026/11-18/react-doctor-findings.webp)

## Cut the noise first

Some findings had nothing to do with my code. One came from the `.output` folder that `pnpm build` produces, and a few came from the `components/ui` files generated by shadcn/ui.

I excluded both from the scan in React Doctor's config file:

```json
{
  "ignore": {
    "files": [".output/**", "src/components/ui/**"]
  }
}
```

This is the first thing to do when you run a scanner for the first time: filter out generated and third-party files. Otherwise the real findings get lost in the noise. I didn't silence any finding in my own code with config, though; for those, I either fixed the code or wrote down why I left it.

## Hooks carried the score

The biggest jump came from a single fix. In the search component, I had defined a hook as an arrow function inside the component and called it twice:

```tsx
function SiteSearch() {
  const usePostsWhenOpen = (category) => useQuery(/* ... */);
  // ...
}
```

The code worked, because the call order never changed. But React's rule is clear: don't call hooks inside nested functions, only at the top level of a component or custom hook.[^hooks] And when React Compiler sees code that might break the rules, it skips optimizing it rather than risk changing the app's behavior.[^compiler] So the component was quietly missing out on automatic memoization.

I moved the hook to module level in the same file, and the behavior stayed the same. The score went from 56 to 75, and three errors disappeared at once.

The last fix was a hidden trap. TanStack Router infers types from the order of route options: `head` has to come after `loader`.[^tanstack-order] In seven route files, `head` came first. Since none of them used loader data yet, nothing had broken, but if one had, the types would have been wrong. Once I fixed the order, the error count dropped to zero. To keep the mistake from coming back, I added the `@tanstack/eslint-plugin-router` package both to this site and to the TanStack templates of [ViraStack Start](https://virastack.com/start).[^router-plugin] Its `create-route-property-order` rule checks the order during lint and fixes it with `--fix`.[^router-rule]

## The suggested fix is sometimes harmful

For most of the remaining findings, the tool couldn't see the context of the code. For example, it suggested moving a date-formatting object to the top of the file; on a bilingual site, that could have shown one visitor's language to another. In another finding, the check it asked for was already there, just inside a different function.

In the end, I fixed 7 of 13 distinct issues and left 6 with a written reason.

## A finding is a hypothesis

The tool itself says this best. The first line of the guidance React Doctor writes for agents asks them to treat findings as starting hypotheses and to read the relevant code before confirming or suppressing each one.[^rd-guidance] The same guidance also says not to suppress a finding without evidence from the file in question.[^rd-guidance]

I did this scan with an agent and we went through every finding one by one. If I had told the agent to "fix everything," the score might have gone even higher, but the site would have broken.

The goal isn't a 100 in React Doctor; this isn't a Lighthouse score. The goal is for React Doctor to catch what we missed, for us to question every finding and to fix it when it needs fixing. Sometimes the answer is "there's no problem here," and that's a result too.

[^rd-readme]: [React Doctor: README](https://github.com/millionco/react-doctor)
[^hooks]: [React: Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks)
[^compiler]: [React: Debugging and Troubleshooting React Compiler](https://react.dev/learn/react-compiler/debugging)
[^tanstack-order]: [TanStack Router: Ensure correct order of inference sensitive properties](https://tanstack.com/router/latest/docs/eslint/create-route-property-order)
[^rd-guidance]: [React Doctor: render-agent-guidance.ts](https://github.com/millionco/react-doctor/blob/main/packages/react-doctor/src/cli/utils/render-agent-guidance.ts)
[^router-plugin]: [TanStack Router: ESLint Plugin Router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)
[^router-rule]: [TanStack Router: create-route-property-order source code](https://github.com/TanStack/router/blob/main/packages/eslint-plugin-router/src/rules/create-route-property-order/create-route-property-order.rule.ts)
