DEV Community

Discussion on: How to: Increase performance with React.memo

Collapse
 
calag4n profile image
calag4n

Hi hmintoh, great post :) react memo is so usefull !
Though, I think you've made a mistake in the first code block :
You wrote:

<List list={users} />

instead of

<List list={names} />

and

const List = ({users}) => {
  console.log('render List');
  return (
    <ul>
      {users.map((user, key) => <li>{user}</li>)};
    </ul>
  )
};

instead of

const List = ({list}) => {
  console.log('render List');
  return (
    <ul>
      {list.map((user, key) => <li>{user}</li>)};
    </ul>
  )
};
Collapse
 
hmintoh profile image
hmintoh • Edited

fixed, thank you for flagging @calag4n !