Closed
Description
react-hooks-testing-library
version: 1.0.4react-test-renderer
version: 16.8.6react
version: 16.8.17@types/react
version: 16.8.17typescript
version: 3.3.3333node
version: 11.9.0npm
version: 6.7.0
Relevant code or config:
-
What you did:
I installed the latest Version of react-hooks-testing-library
and got after a typecheck
the following error.
What happened:
node_modules/@testing-library/react-hooks/node_modules/@types/react/index.d.ts:2817:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
2817 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/react/index.d.ts:2816:14
2816 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
'LibraryManagedAttributes' was also declared here.
node_modules/@testing-library/react-hooks/node_modules/@types/react/index.d.ts:2881:13 - error TS2717: Subsequent property declarations must have the same type. Property 'iframe' must be of type 'DetailedHTMLProps<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>', but here has type 'DetailedHTMLProps<IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>'.
2881 iframe: React.DetailedHTMLProps<React.IframeHTMLAttributes<HTMLIFrameElement>, HTMLIFrameElement>;
~~~~~~
node_modules/@types/react/index.d.ts:2816:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
2816 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@testing-library/react-hooks/node_modules/@types/react/index.d.ts:2817:14
2817 type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
~~~~~~~~~~~~~~~~~~~~~~~~
'LibraryManagedAttributes' was also declared here.
Reproduction:
Problem description:
The issue is that I use the @types/react: 16.8.17
while this library uses @types/react: 16.8.22
which results in 2 different installed @types/react
versions. After updating to the latest @types/react
the problem was solved.
Suggested solution:
There should be any typescript dependency installen when I install this package.