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> ) };
const List = ({list}) => { console.log('render List'); return ( <ul> {list.map((user, key) => <li>{user}</li>)}; </ul> ) };
fixed, thank you for flagging @calag4n !
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi hmintoh, great post :) react memo is so usefull !
Though, I think you've made a mistake in the first code block :
You wrote:
instead of
and
instead of
fixed, thank you for flagging @calag4n !