All jobs / Frontend / web developer

Frontend / web developer interview question · 1–3 years

When does React.memo help, and when does it not?

The strongest answer

It skips re-rendering a component when its props are shallowly equal — helpful for expensive components receiving stable props; useless when a prop is a new object or function every render, or when the component is cheap

Why it works

Right. Shallow prop comparison; new references defeat it.

What a good answer covers

Answers that fall short

Who gets asked this

More Frontend / web developer questions