DEV Community

Mashcuy Lab
Mashcuy Lab

Posted on • Edited on

Advanced React #1

In this article we are summarizing the most interesting parts of:

  • Nadia Makarevich - Advanced React Chapter 1 "Intro to re-renders"

Lifecycle of a component

  • mounting: component is created for the first time
  • unmounting: react removes the component when is no needed
  • re-rendering: updates the component with new information

Myth: components re-render when it's props change

  • when a change over a state happens, react will re-render all the components hierarchy, props doesn't matter
  • react will check props only if we use useMemo it props change it will re-render, not otherwise.

Top comments (0)