How to easily detect which component is re-rendering too often (without installing additional tools)

Dominika Zając (she/her) 🇵🇱 - Mar 12 '22 - - Dev Community

Who has never had a problem with re-rendering components too often, cast the first stone. It happens — it’s a fact. Especially when you are a junior or just entered the frontend world. Without experience that bugs are hard to detect — everything looks fine but the browser is working hard to repaint, repaint and repaint elements on the page. Fortunately, Chrome DevTools offers a way to easily found them. You just need to follow these steps:

  1. Open Chrome browser
  2. Go to page you want to test
  3. Open Chrome Dev Tools (ctrl + shift + I on Linux/Windows or cmd + shift + I on Mac)
  4. Click 3 dots on the right side
  5. Choose Rendering
  6. Check the first checkbox titled Pain flashing there.

Thanks to that all repainted areas will be highlighted in green, so you can interact with a webpage and check if everything works are designed. Piece of cake! You don’t have to worry about having repainting problems on your webpage now.

. . . . . . . . . . . . . . . . . . .
Terabox Video Player