react-native-socials icon indicating copy to clipboard operation
react-native-socials copied to clipboard

Can't compile the module locally

Open LuD1161 opened this issue 5 years ago • 2 comments

Hi @PierreCapo Thanks a lot for this library. I am trying to compile this library locally, however I am getting 14 errors. image

src/Instagram/index.tsx:41:25 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

41     <View style={styles.container(containerBorderRadius)}>
                           ~~~~~~~~~

src/Instagram/index.tsx:45:11 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ImageProps>): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.
          Types of property 'overflow' are incompatible.
            Type '"hidden" | "visible" | "scroll" | undefined' is not assignable to type '"hidden" | "visible" | undefined'.
              Type '"scroll"' is not assignable to type '"hidden" | "visible" | undefined'.
  Overload 2 of 2, '(props: ImageProps, context?: any): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.

45           style={styles.profilePicture}
             ~~~~~

  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'
  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'

src/Instagram/index.tsx:51:13 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ImageProps>): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.
  Overload 2 of 2, '(props: ImageProps, context?: any): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.

51             style={styles.verified}
               ~~~~~

  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'
  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'

src/Instagram/index.tsx:80:31 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

80                 style={styles.postImage(
                                 ~~~~~~~~~

src/Twitter/TwitterText.tsx:84:7 - error TS2322: Type '(string | Element)[]' is not assignable to type 'string[]'.
  Type 'string | Element' is not assignable to type 'string'.
    Type 'Element' is not assignable to type 'string'.

84       transformedText = transformTextToAddColors(
         ~~~~~~~~~~~~~~~

src/Twitter/TwitterText.tsx:93:5 - error TS2322: Type '(string | Element)[]' is not assignable to type 'string[]'.

93     transformedText = transformTextToAddColors(
       ~~~~~~~~~~~~~~~

src/Twitter/TwitterText.tsx:103:5 - error TS2322: Type '(string | Element)[]' is not assignable to type 'string[]'.

103     transformedText = transformTextToAddColors(
        ~~~~~~~~~~~~~~~

src/Twitter/TwitterText.tsx:113:5 - error TS2322: Type '(string | Element)[]' is not assignable to type 'string[]'.

113     transformedText = transformTextToAddColors(
        ~~~~~~~~~~~~~~~

src/Twitter/index.tsx:73:27 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

73       <View style={styles.container(containerBorderRadius)}>
                             ~~~~~~~~~

src/Twitter/index.tsx:97:35 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

97               <View style={styles.embedContainer(cornerRadius)}>
                                     ~~~~~~~~~~~~~~

src/Twitter/index.tsx:105:35 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

105               <View style={styles.embedContainer(cornerRadius)}>
                                      ~~~~~~~~~~~~~~

src/Twitter/index.tsx:109:35 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

109               <View style={styles.embedContainer(cornerRadius)}>
                                      ~~~~~~~~~~~~~~

src/Twitter/index.tsx:118:35 - error TS2349: This expression is not callable.
  No constituent of type 'ViewStyle | TextStyle | ImageStyle' is callable.

118               <View style={styles.embedContainer(cornerRadius)}>
                                      ~~~~~~~~~~~~~~

src/Twitter/index.tsx:153:17 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ImageProps>): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.
  Overload 2 of 2, '(props: ImageProps, context?: any): Image', gave the following error.
    Type 'ViewStyle | TextStyle | ImageStyle' is not assignable to type 'StyleProp<ImageStyle>'.
      Type 'ViewStyle' is not assignable to type 'StyleProp<ImageStyle>'.
        Type 'ViewStyle' is not assignable to type 'ImageStyle'.

153                 style={styles.heart}
                    ~~~~~

  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'
  node_modules/@types/react-native/index.d.ts:3804:5
    3804     style?: StyleProp<ImageStyle>;
             ~~~~~
    The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Image> & Readonly<ImageProps> & Readonly<{ children?: ReactNode; }>'


Found 14 errors.

Am I missing some step :thinking:

LuD1161 avatar Sep 27 '20 12:09 LuD1161

Mmmmh, that's weird, seems like some typings from react native are missing, I don't understand either what's happening

PierreCapo avatar Sep 27 '20 15:09 PierreCapo

Any suggestions what I should do here. I also tried directly installing from npm but in vain.

LuD1161 avatar Sep 27 '20 15:09 LuD1161