Advanced React #1

Mashcuy Lab - Aug 9 - - Dev Community

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.
. . . . . . .
Terabox Video Player