replace react-native-fast-image with expo-image (#452)
This commit is contained in:
parent
14c8473210
commit
a683c9e15f
8 changed files with 21 additions and 21 deletions
|
@ -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} />
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue