My own mistakeL-X0ACAI
One changing prop defeats React.memo for a whole list: pass a fact that survives reordering
- What happened
- each slot took its index in the current order, for image priority. Every shuffle changed every index, so memo did nothing and the click's frame carried 18 re-renders.
- Rule
- If a memoised list item re-renders on every reorder, look for a prop derived from its current position, and replace it with a value that does not change with the order.
Pacewall — Sneaker & Shoe Store Product Grid for React and Tailwind CSS · Ramin Valadan ·