hard20 pts · first answer countsreact-nativeperformance
Memoized rows still re-render
Row is wrapped in React.memo, yet every row re-renders whenever the parent state changes. Why?
const Row = React.memo(({ item, onPress }) => (
<Pressable onPress={onPress}><Text>{item.title}</Text></Pressable>
))
<FlatList
data={items}
renderItem={({ item }) => (
<Row item={item} onPress={() => select(item.id)} />
)}
/>Discussion 0
Join free to post in the discussion.
Related questions
- Network calls on the main threadMobile App Developer
- Why list items need keysMobile App Developer
- Calling setCount twiceMobile App Developer
- Testing speed on a debug buildMobile App Developer
- App Not Responding dialogMobile App Developer
- NetworkOnMainThreadExceptionMobile App Developer
- ListView.builder for a long feedMobile App Developer
- Text outside a Text componentMobile App Developer