Skip to content

Fix tintColor in fallback image #882

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

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,18 @@ exports[`Renders Image with fallback prop. 1`] = `
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
Array [
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
},
Object {
"tintColor": undefined,
},
]
}
/>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type FastImageProps = $ReadOnly<{|

source: FastImageSource | number,

tintColor?: number | string,
resizeMode?: ?ResizeModes,
fallback?: ?boolean,
testID?: ?string,
Expand Down
3 changes: 1 addition & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export interface ImageStyle extends FlexStyle, TransformsStyle, ShadowStyleIOS {
borderTopLeftRadius?: number
borderTopRightRadius?: number
overlayColor?: string
tintColor?: string
opacity?: number
}

Expand Down Expand Up @@ -154,7 +153,7 @@ function FastImageBase({
<View style={[styles.imageContainer, style]} ref={forwardedRef}>
<Image
{...props}
style={StyleSheet.absoluteFill}
style={[StyleSheet.absoluteFill, { tintColor: tintColor as any }]}
source={resolvedSource}
onLoadStart={onLoadStart}
onProgress={onProgress}
Expand Down