fix: update AnimatedBlurhash to use Animated.View for improved performance (#756)

This commit is contained in:
skalthoff
2025-12-05 10:04:27 -08:00
committed by GitHub
parent d22eb6cbb6
commit ef4779298b
2 changed files with 7 additions and 9 deletions

View File

@@ -78,13 +78,14 @@ interface ItemBlurhashProps {
testID?: string | undefined
}
const AnimatedBlurhash = Animated.createAnimatedComponent(Blurhash)
const Styles = StyleSheet.create({
blurhash: {
width: '100%',
height: '100%',
},
blurhashInner: {
...StyleSheet.absoluteFillObject,
},
})
const ItemBlurhash = memo(
@@ -92,13 +93,9 @@ const ItemBlurhash = memo(
const blurhash = getBlurhashFromDto(item, type)
return (
<AnimatedBlurhash
resizeMode={'cover'}
style={Styles.blurhash}
blurhash={blurhash}
entering={FadeIn}
exiting={FadeOut}
/>
<Animated.View style={Styles.blurhash} entering={FadeIn} exiting={FadeOut}>
<Blurhash resizeMode={'cover'} style={Styles.blurhashInner} blurhash={blurhash} />
</Animated.View>
)
},
(prevProps: ItemBlurhashProps, nextProps: ItemBlurhashProps) =>

View File

@@ -80,6 +80,7 @@ export const Miniplayer = React.memo(function Miniplayer(): React.JSX.Element {
return (
<GestureDetector gesture={gesture}>
<Animated.View
collapsable={false}
testID='miniplayer-test-id'
entering={FadeInDown.springify()}
exiting={FadeOutDown.springify()}