react-native-user-avatar icon indicating copy to clipboard operation
react-native-user-avatar copied to clipboard

textStyle prop not working. Also cannot find type declarations

Open ahnafnafee opened this issue 4 years ago • 6 comments

Using version v1.0.8.

<UserAvatar
      size={90}
      name={`${card.firstName} ${card.lastName}`}
      src={card.profilePicUrl}
      borderRadius={90 / 2}
      style={{
          borderColor: "#00A5B9",
          borderWidth: 3,
      }}
      textStyle={{
          fontFamily: 'OpenSans-Bold',
          fontSize: 20,
      }}
/>

Referred to these two issues first (#62 and #60 ) where it was mentioned it was resolved in v1.0.8 but I am still getting the issue.

Here's how the types are referenced in package.json for react-native-user-avatar in v1.0.8

"react-native": "src/index.js",
  "types": "lib/typescript/src/index.d.ts",
  "files": [
    "lib/",
    "src/"
  ],

ahnafnafee avatar Feb 05 '22 01:02 ahnafnafee

Thanks @ahnafnafee, working on a fix

avishayil avatar Feb 05 '22 09:02 avishayil

+1

jay-jlm avatar Mar 03 '22 01:03 jay-jlm

Any news? Sadly, this issue still exists.

alexanderdavide avatar May 30 '22 12:05 alexanderdavide

any update?

lhr000lhr avatar Jul 26 '22 06:07 lhr000lhr

As a temporary fix for typescript add the code mention in the comment - https://github.com/avishayil/react-native-user-avatar/issues/60#issue-696662504 to an index.d.ts file and refer it in you tsconfig.json file. For example I have create file with the above code in src/types/libs/react-native-user-avatar/index.d.ts and added it to to tsconfig as shown below

"compilerOptions": {
    "strict": true,
    "paths": {
      "*": [ "./src/types/libs/*"]
    }
  }

DonBrowny avatar Aug 06 '22 14:08 DonBrowny

any update to textStyle?

brunofray avatar Aug 29 '22 19:08 brunofray