Best Practices ●
Make sure optimization is a sensible one! ○ Every optimization comes with a tradeoff ○ Measure performance first
●
Don’t pass new references ( arrays, objects, functions) as props to components.
●
Use a unique and stable key value for a list. Minimum usage is index (be cautious)
●
Pass only the props that are needed by the component (no “…props”)
●
Consider PureComponents (class) or React.memo (functional) for the following scenarios: props that rarely change, components that renders often
●
useMemo to memoize expensive calculations