Memoize renderItem
This commit is contained in:
@@ -129,7 +129,8 @@ export const ProfileFeedgens = React.forwardRef<
|
||||
// rendering
|
||||
// =
|
||||
|
||||
const renderItem = ({item, index}: ListRenderItemInfo<any>) => {
|
||||
const renderItem = React.useCallback(
|
||||
({item, index}: ListRenderItemInfo<any>) => {
|
||||
if (item === EMPTY) {
|
||||
return (
|
||||
<EmptyState
|
||||
@@ -168,7 +169,9 @@ export const ProfileFeedgens = React.forwardRef<
|
||||
)
|
||||
}
|
||||
return null
|
||||
}
|
||||
},
|
||||
[_, t, error, refetch, onPressRetryLoadMore, preferences],
|
||||
)
|
||||
|
||||
React.useEffect(() => {
|
||||
if (enabled && scrollElRef.current) {
|
||||
|
||||
Reference in New Issue
Block a user