Skip to content

Commit

Permalink
fix: pass all styles to android image
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed Mar 31, 2023
1 parent 9b0c0c7 commit 35996c7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,7 @@ const AndroidImage = (props: FasterImageProps) => {
return (
<Image
source={{ uri: props.url, cache: 'force-cache' }}
// eslint-disable-next-line react-native/no-inline-styles
style={{
...props.style,
width: props.style.width ?? 0,
height: props.style.height ?? 0,
borderRadius: props.rounded ? (Number(props.style.width) ?? 0) / 2 : 0,
}}
style={props.style}
onError={props.onError}
onLoad={(event) => {
const { width, height } = event.nativeEvent.source;
Expand Down Expand Up @@ -96,5 +90,6 @@ const AndroidImage = (props: FasterImageProps) => {
* */
export const FasterImageView = Platform.select({
ios: requireNativeComponent<FasterImageProps>(ComponentName),
android: AndroidImage as any,
// @ts-ignore
android: AndroidImage,
});

0 comments on commit 35996c7

Please sign in to comment.