# How do you find duplicate React components?

Source: https://saer.app/guides/find-duplicate-react-components
Updated: 2026-10-22

**Short answer.** Search for component names is not enough: aliases, barrels and default exports hide duplicates. Build an inventory of every component definition, resolve every JSX use to the definition it actually renders, then flag the same exported name defined in more than one file. For each pair, compare props, root element and use counts, so you can tell a true duplicate from two unrelated components that happen to share a name.

## Why duplicates matter more with agents

When two `Breadcrumbs` exist, a person usually knows which is current. An agent searching by name finds whichever it reaches first. In Lunary, Saer found 15 component names defined twice; one `Breadcrumbs` is used 29 times, the other once.

## Resolve uses properly

A use site only counts if it resolves to the right definition: through relative imports, tsconfig `paths`, workspace packages, barrels and `export *` chains, aliased and namespace imports, `next/dynamic` and `React.lazy`. Imports that cannot be resolved should be reported as such, not guessed.

## Check before deleting

An unused component is only unused after every check that could make the claim wrong: dynamic imports, string maps, unresolved imports, public package exports, and packages outside the scan.

## What Saer does about this today

- Components: inventory, use sites, exact-name duplicates with evidence, variant findings, overrides and unused components.

## Not built yet

- Component frameworks other than React (Vue, Svelte, SwiftUI): planned.
