Skip to content

Separated viewStyle and textStyle keys #114

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SteveYuOWO
Copy link

Fix error of #111 .
In the expo project, a strict type error occurs.

searchBar needs to be strictly defined as TextStyle, and the rest of keys need to be defined as ViewStyle.

✖ tsc --project tsconfig.json --alwaysStrict:
node_modules/react-native-country-codes-picker/index.tsx(271,37): error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: TextInputProps): TextInput', gave the following error.
    Type 'ViewStyle' is not assignable to type 'Falsy | TextStyle | RegisteredStyle<TextStyle> | RecursiveArray<Falsy | TextStyle | RegisteredStyle<TextStyle>> | readonly (Falsy | ... 1 more ... | RegisteredStyle<...>)[]'.
      Type 'ViewStyle' is not assignable to type 'TextStyle'.
        Types of property 'userSelect' are incompatible.
          Type 'string | undefined' is not assignable to type '"text" | "auto" | "none" | "contain" | "all" | undefined'.
            Type 'string' is not assignable to type '"text" | "auto" | "none" | "contain" | "all" | undefined'.
  Overload 2 of 2, '(props: TextInputProps, context: any): TextInput', gave the following error.
    Type 'ViewStyle' is not assignable to type 'Falsy | TextStyle | RegisteredStyle<TextStyle> | RecursiveArray<Falsy | TextStyle | RegisteredStyle<TextStyle>> | readonly (Falsy | ... 1 more ... | RegisteredStyle<...>)[]'.
      Type 'ViewStyle' is not assignable to type 'TextStyle'.
        Types of property 'userSelect' are incompatible.
          Type 'string | undefined' is not assignable to type '"text" | "auto" | "none" | "contain" | "all" | undefined'.
            Type 'string' is not assignable to type '"text" | "auto" | "none" | "contain" | "all" | undefined'.
image

@SteveYuOWO SteveYuOWO changed the title fix: separated viewStyle and textStyle keys Separated viewStyle and textStyle keys Dec 11, 2024
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

Successfully merging this pull request may close these issues.

1 participant