React.memo

React Native 6 min min read Updated: Aug 03, 2026 Intermediate
React.memo
Intermediate Topic 9 of 18

React.memo

React.memo is a higher-order component that prevents a functional component from re-rendering if its props have not changed, helping optimize performance in React Native applications.

Basic Usage

javascript const ProductCard = React.memo(({ product }) => { return ( {product.name} {product.price} ); });

How React.memo Works

React.memo performs a shallow comparison of the previous and new props. If they are equal, React skips re-rendering the component and reuses the last rendered output.

Combining with useCallback and useMemo

React.memo is most effective when combined with useCallback and useMemo for any function or object props, since new object or function references on every render would otherwise defeat the shallow comparison.

javascript const handlePress = useCallback(() => onSelect(item.id), [item.id, onSelect]);

Custom Comparison Function

React.memo accepts an optional second argument, a custom comparison function, allowing fine-grained control over exactly which prop changes should trigger a re-render.

javascript const ProductCard = React.memo( ({ product }) => {product.name}, (prevProps, nextProps) => prevProps.product.id === nextProps.product.id );

When to Use React.memo

React.memo is most beneficial for components that render frequently with the same props, particularly items within large lists like FlatList, where unnecessary re-renders can noticeably impact scroll performance.

When React.memo Does Not Help

If a component’s props change on nearly every render anyway, wrapping it in React.memo provides no benefit and adds a small unnecessary comparison overhead.

Conclusion

React.memo, combined properly with useCallback and useMemo, is a powerful tool for reducing unnecessary re-renders in React Native applications, particularly valuable for optimizing list item components.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators