Upgrade types/react types/react-dom and restore yarn.lock
@types/react
and @types/react-dom
declare both the same types, which TSC does not like (it raises more or less 10 errors):
node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:2967:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
2967 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~"🤓 deployment"
node_modules/@types/react/index.d.ts:2982:14
2982 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
'LibraryManagedAttributes' was also declared here.
Why does the fix work:
- @types/react-dom depends on @types/react version "*" (all version match, so yarn installs always the last version available)
- the yarn.lock was generated after deleting yarn.lock/node_modules,
- the
resolutions
statement in thepackage.json
allows to fix the used version when installing @types/react-dom (for future installs).
Edited by Antoine