You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgraded my app to expo 52 and react native 0.76, after that I run lint and typescript checks and I started getting type errors from this package.
> tsc
node_modules/@kolking/react-native-avatar/src/Avatar.tsx:20:18 - error TS2430: Interface 'Props' incorrectly extends interface 'ViewProps'.
Types of property 'style' are incompatible.
Type 'StyleProp<ImageStyle>' is not assignable to type 'StyleProp<ViewStyle>'.
Type 'ImageStyle' is not assignable to type 'StyleProp<ViewStyle>'.
Type 'ImageStyle' is not assignable to type 'ViewStyle'.
Types of property 'transformOrigin' are incompatible.
Type 'string | (string | number)[] | undefined' is not assignable to type 'string | undefined'.
Type '(string | number)[]' is not assignable to type 'string'.
20 export interface Props extends ViewProps {
~~~~~
node_modules/@kolking/react-native-avatar/src/Avatar.tsx:78:11 - error TS2322: Type 'StyleProp<ImageStyle>' is not assignable to type 'StyleProp<ViewStyle>'.
Type 'ImageStyle' is not assignable to type 'StyleProp<ViewStyle>'.
Type 'ImageStyle' is not assignable to type 'ViewStyle'.
Types of property 'transformOrigin' are incompatible.
Type 'string | (string | number)[] | undefined' is not assignable to type 'string | undefined'.
Type '(string | number)[]' is not assignable to type 'string'.
78 style={style}
~~~~~
node_modules/react-native/Libraries/Components/View/ViewPropTypes.d.ts:203:3
203 style?: StyleProp<ViewStyle> | undefined;
~~~~~
The expected type comes from property 'style' which is declared here on type 'IntrinsicAttributes & Props'
Found 2 errors in the same file, starting at: node_modules/@kolking/react-native-avatar/src/Avatar.tsx:20
After investigation I noticed one detail in the implementation, you use StyleProp<ImageStyle> for styling both View and Image components which can't be right, and with strict typescript this should fail, or at least that's how I understand it 😅
Hi! 👋
Firstly, thanks for your work on this project! 🙂
I upgraded my app to expo 52 and react native 0.76, after that I run lint and typescript checks and I started getting type errors from this package.
After investigation I noticed one detail in the implementation, you use
StyleProp<ImageStyle>
for styling both View and Image components which can't be right, and withstrict
typescript this should fail, or at least that's how I understand it 😅Here is the diff that solved my problem:
The text was updated successfully, but these errors were encountered: