Skip to content
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

invalid Type imports from react-native-paper #97

Closed
lucksp opened this issue Jul 26, 2023 · 0 comments
Closed

invalid Type imports from react-native-paper #97

lucksp opened this issue Jul 26, 2023 · 0 comments

Comments

@lucksp
Copy link

lucksp commented Jul 26, 2023

We are getting tsc errors in the library, even though we're not supposed to check for node_modules:

node_modules/react-native-paper/src/components/Icon.tsx:96:8 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: ImageProps | Readonly<ImageProps>): Image', gave the following error.
    Type '{ accessibilityIgnoresInvertColors: true; role: string; focusable: boolean; accessibilityElementsHidden?: undefined; importantForAccessibility?: undefined; source: any; style: ({ transform: { ...; }[]; } | { ...; })[]; allowFontScaling?: boolean | undefined; } | { ...; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps>'.
      Type '{ accessibilityIgnoresInvertColors: true; role: string; focusable: boolean; accessibilityElementsHidden?: undefined; importantForAccessibility?: undefined; source: any; style: ({ transform: { ...; }[]; } | { ...; })[]; allowFontScaling?: boolean | undefined; }' is not assignable to type 'Readonly<ImageProps>'.
        Types of property 'role' are incompatible.
          Type 'string' is not assignable to type 'Role | undefined'.
  Overload 2 of 2, '(props: ImageProps, context: any): Image', gave the following error.
    Type '{ accessibilityIgnoresInvertColors: true; role: string; focusable: boolean; accessibilityElementsHidden?: undefined; importantForAccessibility?: undefined; source: any; style: ({ transform: { ...; }[]; } | { ...; })[]; allowFontScaling?: boolean | undefined; } | { ...; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps>'.
      Type '{ accessibilityIgnoresInvertColors: true; role: string; focusable: boolean; accessibilityElementsHidden?: undefined; importantForAccessibility?: undefined; source: any; style: ({ transform: { ...; }[]; } | { ...; })[]; allowFontScaling?: boolean | undefined; }' is not assignable to type 'Readonly<ImageProps>'.
        Types of property 'role' are incompatible.
          Type 'string' is not assignable to type 'Role | undefined'.

96       <Image
          ~~~~~


node_modules/react-native-paper/src/components/TextInput/Adornment/TextInputAdornment.tsx:9:32 - error TS2307: Cannot find module 'src/types' or its corresponding type declarations.

9 import type { ThemeProp } from 'src/types';
                                 ~~~~~~~~~~~

node_modules/react-native-paper/src/components/TextInput/TextInputFlat.tsx:14:32 - error TS2307: Cannot find module 'src/types' or its corresponding type declarations.

14 import type { ThemeProp } from 'src/types';
                                  ~~~~~~~~~~~

If I reference the errors within react-native-paper-dropdown, the following Dropdown.d.ts file shows errors related to:

import { Theme } from "react-native-paper/lib/typescript/types";
import { TextInputProps } from "react-native-paper/lib/typescript/components/TextInput/TextInput";

As you can see in react-native-paper npm package, the lib directory does not match with actual:

image

The TextInputProps should be:

import { TextInputProps } from "react-native-paper";

There is no Theme in the react-native-paper anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants