ReactAdvanced#performance

What is React.memo?

A higher-order component that skips re-rendering a component when its props are shallowly equal to the previous props. It helps only when the component is expensive and its props are stable.

Example
const Row = React.memo(function Row({ item }) {
  return <li>{item.name}</li>;
});

Related Questions

1
ReactIntermediate#hooks#context

What is useContext and when do you use it?

Open
2
ReactAdvanced#hooks#state

When should you use useReducer instead of useState?

Open
3
ReactIntermediate#hooks

How do you create a custom hook?

Open