What
Fix the TypeScript "Duplicate identifier 'LibraryManagedAttributes'" error in React projects.
Why
When two packages depend on compatible ranges of @types/react, Yarn can still install duplicate versions and TypeScript sees conflicting global declarations. yarn-deduplicate can select one version that satisfies both ranges. If the ranges are incompatible, align the dependencies or add a resolution before deduplicating.
How
npx yarn-deduplicate yarn.lock
Then reinstall dependencies:
yarn install