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