Closed
Description
@eps1lon we see type errors since this change:
node_modules/@testing-library/react/types/index.d.ts:129:52 - error TS2344: Type 'Container' does not satisfy the constraint 'Element | DocumentFragment'.
Type 'Document | Container' is not assignable to type 'Element | DocumentFragment'.
Type 'Document' is not assignable to type 'Element | DocumentFragment'.
Type 'Document' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 100 more.
Type 'Container' is not assignable to type 'DocumentFragment'.
Type 'Document | Container' is not assignable to type 'DocumentFragment'.
Type 'Document' is not assignable to type 'DocumentFragment'.
Types of property 'ownerDocument' are incompatible.
Type 'null' is not assignable to type 'Document'.
can be reproduced with:
mkdir check-testinglib
cd check-testinglib
npm init -y
npm i react react-dom @types/react @types/react-dom typescript @testing-library/react
npx tsc --init --outDir dist --skipLibCheck false
echo "export * from '@testing-library/react';" > test.ts
npx tsc --noEmit
Originally posted by @AviVahl in #1304 (comment)