Skip to content

Commit 63b7fa5

Browse files
committed
fix: apply changes to headers under conditions
1 parent f867dde commit 63b7fa5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,12 @@ function FastImageBase({
195195
)
196196
}
197197

198+
// @ts-ignore non-typed property
199+
const FABRIC_ENABLED = !!global?.nativeFabricUIManager;
200+
198201
// this type differs based on the `source` prop passed
199202
const resolvedSource = Image.resolveAssetSource(source as any) as ImageResolvedAssetSource & {headers: any}
200-
if (resolvedSource?.headers) {
203+
if (resolvedSource?.headers && (FABRIC_ENABLED || Platform.OS === 'android')) {
201204
// we do it like that to trick codegen
202205
const headersArray: {name: string, value: string}[] = [];
203206
Object.keys(resolvedSource.headers).forEach(key => {

0 commit comments

Comments
 (0)