Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know a component's render times

Tags:

reactjs

As the title shows, Can i know how many times when a class component or a functional component render? Is there any chrome extension or webpack plugin? And now i just can get this by console.log.

just console.log to log the times.

like image 874
max Avatar asked Sep 14 '25 13:09

max


1 Answers

You should use react-devtools:

  1. Install react-devtools extension.
  2. While on a development environment, excess your browser dev tools.

enter image description here

  1. Go to Profiler tab
  2. Press Start-Profiling

enter image description here

  1. Examine the snapshot

enter image description here

Dashboard Component (0.6ms of 86.ms) - Rendered at 1.3 for 83ms

Refer to official walkthrough video of the profiler on YouTube.

like image 109
Dennis Vash Avatar answered Sep 17 '25 04:09

Dennis Vash