Skip to content

Type error when upgrading from 11.5 to 11.5.1 with skipLibCheck: false and using RN 0.70 #1351

Closed
@AugustinLF

Description

@AugustinLF

Describe the bug

While trying to upgrade to the RC (anyone could link me the thread where we were discussing the RC, I can't find it anymore), I realised I missed some minors updates, and found breaking types between 11.5.0 and 11.5.1.

node_modules/@testing-library/react-native/build/within.d.ts:48:152 - error TS2307: Cannot find module 'react-native/types' or its corresponding type declarations.

48     getAllByRole: import("./queries/makeQueries").GetAllByQuery<import("./matches").TextMatch, import("./queries/options").CommonQueryOptions & import("react-native/types").AccessibilityState & {
                                                                                                                                                          ~~~~~~~~~~~~~~~~~~~~

...

18  node_modules/@testing-library/react-native/build/render.d.ts:51
18  node_modules/@testing-library/react-native/build/within.d.ts:32

All errors are regarding the way the import of AccessibilityState is done as part of our build output.

Steps to Reproduce

Simply create a repo with RN@0.70 and a version of RNTL>=11.5.1, make sure to have skipLibCheck: false in the compilerOptions of your tsconfig and run typescript.

Versions

  npmPackages:
    @testing-library/react-native: 12.0.0-rc.0 => 12.0.0-rc.0
    react: 18.1.0 => 18.1.0
    react-native: 0.70.6 => 0.70.6
    react-test-renderer: 18.1.0 => 18.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions