-
Notifications
You must be signed in to change notification settings - Fork 1.1k
The inferred type of 'renderWithTheme' cannot be named without a reference to @types/testing-library__dom/queries'. This is likely not portable. A type annotation is necessary. #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
All typings are the freshest one |
The solution was to set |
@RIP21 do you mean the compiler option |
@CodingDive yes. It's not guaranteed to fix the issue surely, but sometimes it indeed fixes it. Another way to try to fix it is described here |
Regarding |
I had both |
- testing-library/react-testing-library#587 - microsoft/TypeScript#36800 - Directly add indirect type deps required by testing utils
- testing-library/react-testing-library#587 - prevents 'inferred type of 'renderWithTheme' cannot be named'
* feat(PPDSC-2242): update to node 18 * feat(PPDSC-2242): update types * feat(PPDSC-2242): remove @types/tar * feat(PPDSC-2242): update unite tests * feat(PPDSC-2242): update select and form tests * feat(PPDSC-2242): update form tests * feat(PPDSC-2242): update test * feat(PPDSC-2242): update tests after merge main * feat(PPDSC-2242): update e2e build for react 18 * feat(PPDSC-2242): fix doc site build for react 18 * feat(PPDSC-2242): update links * feat(PPDSC-2242): update links * feat(PPDSC-2242): bump cypress cache version * feat(PPDSC-2242): update cypress version * feat(PPDSC-2242): fix hydration using span * feat(PPDSC-2242): fix hydration using span 2 * feat(PPDSC-2242): fix column-renderer * feat(PPDSC-2242): fix hydration using span 3 * feat(PPDSC-2242): add wait to accessibility tests * feat(PPDSC-2242): small changes to tidy up code * feat(PPDSC-2242): update type * feat(PPDSC-2242): textBlock to styled TextBlock * feat(PPDSC-2242): fix story * feat(PPDSC-2242): update yarn.lock * feat(PPDSC-2242): add type after merge * feat(PPDSC-2242): remove unused border card prop * feat(PPDSC-2242): update node version required by deps * feat(PPDSC-2242): revert base card changes * feat(PPDSC-2242): tidy base card typings * feat(PPDSC-2242): revert content base changes * feat(PPDSC-2242): revert content base changes * feat(PPDSC-2242): fix feature card types and revert styling * feat(PPDSC-2242): revert line truncation changes * feat(PPDSC-2242): revert media list changes * feat(PPDSC-2242): revert usage card changes * feat(PPDSC-2242): revert section intro changes * feat(PPDSC-2242): revert table snapshot * feat(PPDSC-2242): revert tabs with table snapshots * feat(PPDSC-2242): revert text-section snapshots * feat(PPDSC-2242): revert pages/components changes * feat(PPDSC-2242): revert getting-started changes * feat(PPDSC-2242): revert getting-started/design changes * feat(PPDSC-2242): revert component page template test change * feat(PPDSC-2242): revert template snapshot changes * feat(PPDSC-2242): revert base card changes - children is not used by base card - remove from interface and remove unused prop in component * feat(PPDSC-2242): revert component api snapshots * feat(PPDSC-2242): add expicit types for test render utils - testing-library/react-testing-library#587 - prevents 'inferred type of 'renderWithTheme' cannot be named' * feat(PPDSC-2242): revert swatch card changes * feat(PPDSC-2242): revert accordion test changes * feat(PPDSC-2242): remove seek bar explicit any * feat(PPDSC-2242): remove unknown typing from floating els * feat(PPDSC-2242): update base switch types * feat(PPDSC-2242): add undefined error text * feat(PPDSC-2242): remove grid-layout fragment * feat(PPDSC-2242): update menu title syntax * feat(PPDSC-2242): Revert "feat(PPDSC-2242): revert swatch card changes" This reverts commit 6e85495. * feat(PPDSC-2242): fix list types - Support single child and array of children * feat(PPDSC-2242): update popover types * feat(PPDSC-2242): revert radio button changes * feat(PPDSC-2242): fix select typing * feat(PPDSC-2242): mock downshift ids to make select tests less brittle * feat(PPDSC-2242): revert stack changes * feat(PPDSC-2242): fix text-input types * feat(PPDSC-2242): fix toast types * feat(PPDSC-2242): revert unordered list changes * feat(PPDSC-2242): mock ids to make audio player tests less brittle * feat(PPDSC-2242): fix form input type * feat(PPDSC-2242): update test utils types * feat(PPDSC-2242): fix popover test warnings * feat(PPDSC-2242): use act in audio player tests * feat(PPDSC-2242): use act in tooltip tests to prevent warnings * feat(PPDSC-2242): revert cypress version bump * feat(PPDSC-2242): remove conflicting static dirs config - -s storybook cli command will be deprected in v7 - need to update package.json scripts before then * feat(PPDSC-2242): correct menu types * feat(PPDSC-2242): add private fonts Co-authored-by: mikef <[email protected]> Co-authored-by: Stoyan Delev <[email protected]> Co-authored-by: Stoyan Delev <[email protected]>
* feat(PPDSC-2242): update to node 18 * feat(PPDSC-2242): update types * feat(PPDSC-2242): remove @types/tar * feat(PPDSC-2242): update unite tests * feat(PPDSC-2242): update select and form tests * feat(PPDSC-2242): update form tests * feat(PPDSC-2242): update test * feat(PPDSC-2242): update tests after merge main * feat(PPDSC-2242): update e2e build for react 18 * feat(PPDSC-2242): fix doc site build for react 18 * feat(PPDSC-2242): update links * feat(PPDSC-2242): update links * feat(PPDSC-2242): bump cypress cache version * feat(PPDSC-2242): update cypress version * feat(PPDSC-2242): fix hydration using span * feat(PPDSC-2242): fix hydration using span 2 * feat(PPDSC-2242): fix column-renderer * feat(PPDSC-2242): fix hydration using span 3 * feat(PPDSC-2242): add wait to accessibility tests * feat(PPDSC-2242): small changes to tidy up code * feat(PPDSC-2242): update type * feat(PPDSC-2242): textBlock to styled TextBlock * feat(PPDSC-2242): fix story * feat(PPDSC-2242): update yarn.lock * feat(PPDSC-2242): add type after merge * feat(PPDSC-2242): remove unused border card prop * feat(PPDSC-2242): update node version required by deps * feat(PPDSC-2242): revert base card changes * feat(PPDSC-2242): tidy base card typings * feat(PPDSC-2242): revert content base changes * feat(PPDSC-2242): revert content base changes * feat(PPDSC-2242): fix feature card types and revert styling * feat(PPDSC-2242): revert line truncation changes * feat(PPDSC-2242): revert media list changes * feat(PPDSC-2242): revert usage card changes * feat(PPDSC-2242): revert section intro changes * feat(PPDSC-2242): revert table snapshot * feat(PPDSC-2242): revert tabs with table snapshots * feat(PPDSC-2242): revert text-section snapshots * feat(PPDSC-2242): revert pages/components changes * feat(PPDSC-2242): revert getting-started changes * feat(PPDSC-2242): revert getting-started/design changes * feat(PPDSC-2242): revert component page template test change * feat(PPDSC-2242): revert template snapshot changes * feat(PPDSC-2242): revert base card changes - children is not used by base card - remove from interface and remove unused prop in component * feat(PPDSC-2242): revert component api snapshots * feat(PPDSC-2242): add expicit types for test render utils - testing-library/react-testing-library#587 - prevents 'inferred type of 'renderWithTheme' cannot be named' * feat(PPDSC-2242): revert swatch card changes * feat(PPDSC-2242): revert accordion test changes * feat(PPDSC-2242): remove seek bar explicit any * feat(PPDSC-2242): remove unknown typing from floating els * feat(PPDSC-2242): update base switch types * feat(PPDSC-2242): add undefined error text * feat(PPDSC-2242): remove grid-layout fragment * feat(PPDSC-2242): update menu title syntax * feat(PPDSC-2242): Revert "feat(PPDSC-2242): revert swatch card changes" This reverts commit 6e85495. * feat(PPDSC-2242): fix list types - Support single child and array of children * feat(PPDSC-2242): update popover types * feat(PPDSC-2242): revert radio button changes * feat(PPDSC-2242): fix select typing * feat(PPDSC-2242): mock downshift ids to make select tests less brittle * feat(PPDSC-2242): revert stack changes * feat(PPDSC-2242): fix text-input types * feat(PPDSC-2242): fix toast types * feat(PPDSC-2242): revert unordered list changes * feat(PPDSC-2242): mock ids to make audio player tests less brittle * feat(PPDSC-2242): fix form input type * feat(PPDSC-2242): update test utils types * feat(PPDSC-2242): fix popover test warnings * feat(PPDSC-2242): use act in audio player tests * feat(PPDSC-2242): use act in tooltip tests to prevent warnings * feat(PPDSC-2242): revert cypress version bump * feat(PPDSC-2242): remove conflicting static dirs config - -s storybook cli command will be deprected in v7 - need to update package.json scripts before then * feat(PPDSC-2242): correct menu types * feat(PPDSC-2242): add private fonts Co-authored-by: mikef <[email protected]> Co-authored-by: Stoyan Delev <[email protected]> Co-authored-by: Stoyan Delev <[email protected]>
is the file called renderWithTheme? this is what fixed this issue for me when creating a custom renderer for RTL |
If someone still has the issue, I fixed it by adding the returned type as follow:
|
Hi @solyane2002 Where did you add that? |
Hi, as follow:
|
@testing-library/react
version: 9.4.0react
version: 16.12.0node
version: 12.14.1pnpm
version: 4.9.3yarn
version: 1.21.1Relevant code or config:
What you did:
What happened:
Reproduction:
component
and returnsrender(component)
tsc
with following configProblem description:
I tried
yarn
as well as thepnpm
, the result is the same all the time.Cannot compile declarations with this error:
Suggested solution:
I have no idea.
The text was updated successfully, but these errors were encountered: