React Flashcards

1
Q

how can use props to optimize React re-renders

A

“Lift” the expensive component to a parent where it will be rendered less often.
Then pass the expensive component down as a prop.

Basically you can render a prop {props.anything} like {children}
and if anything is a component, it won’t rerender in next child’s rerenders

How well did you know this?
1
Not at all
2
3
4
5
Perfectly