replace react-native-fast-image with expo-image (#452)

This commit is contained in:
Paul Frazee 2023-04-11 12:12:34 -07:00 committed by GitHub
parent 14c8473210
commit a683c9e15f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 21 deletions

View file

@ -1,12 +1,12 @@
import React from 'react'
import FastImage, {FastImageProps, Source} from 'react-native-fast-image'
export default FastImage
export type {OnLoadEvent, ImageStyle, Source} from 'react-native-fast-image'
import {Image, ImageProps, ImageSource} from 'expo-image'
export function HighPriorityImage({source, ...props}: FastImageProps) {
interface HighPriorityImageProps extends ImageProps {
source: ImageSource
}
export function HighPriorityImage({source, ...props}: HighPriorityImageProps) {
const updatedSource = {
uri: typeof source === 'object' && source ? source.uri : '',
priority: FastImage.priority.high,
} as Source
return <FastImage source={updatedSource} {...props} />
} satisfies ImageSource
return <Image source={updatedSource} {...props} />
}