From d61da11c5057df1429998365cf34c03cb39b3761 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 19 Jan 2025 14:28:09 +0000 Subject: [PATCH] Memoize rows --- src/screens/VideoFeed/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/screens/VideoFeed/index.tsx b/src/screens/VideoFeed/index.tsx index cceac1afa6..605d229ee3 100644 --- a/src/screens/VideoFeed/index.tsx +++ b/src/screens/VideoFeed/index.tsx @@ -1,4 +1,4 @@ -import {useCallback, useEffect, useMemo, useRef, useState} from 'react' +import {memo, useCallback, useEffect, useMemo, useRef, useState} from 'react' import { LayoutAnimation, ListRenderItem, @@ -444,7 +444,7 @@ function keyExtractor(item: FeedPostSliceItem) { return item._reactKey } -function VideoItem({ +let VideoItem = ({ player, post, embed, @@ -460,7 +460,7 @@ function VideoItem({ scrollGesture: NativeGesture moderation?: ModerationDecision feedContext: string | undefined -}) { +}): React.ReactNode => { const postShadow = usePostShadow(post) const {width, height} = useSafeAreaFrame() const {sendInteraction} = useFeedFeedbackContext() @@ -525,6 +525,7 @@ function VideoItem({ ) } +VideoItem = memo(VideoItem) function VideoItemInner({ player,