Follow us

React Developer Tool New Updates

React Developer Tool, having some of great features which you can use in your daily development and specially profiler timeline to track your page performance.

 

You can simply add extension to google chrome(if you do not have already) and then on using chrome developer tool(F12) for your React web app, you will see two new tab i.e. "Component" and "Profiler".

 

Chrome Extension:

https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en

 

With "Component" tab, you could see all the components used for that page in left side and right side you will see selected component informations like state, props etc.

C (D localhost:3000/Listltems 
IS IS ea er area. 
Hame I UserFarm I SignupForm+Userld I Listltems+Batching I 
SuspenseListltems I SuspenseDemoFakeData I ListltemFilter-UseTransition I 
ConcurrentListUsers-UseTransitian I UserDetails & Add I 
ncExternalStore I T 
App component load. 
Demo: Auto batching applied due to react 18 upgrade. You can check the 
console log where endpoint fetch itemes and render one time only. 
Same example, you can refer with "ReactTest" app which is in react 17 and 
there having multiple render because of multiple state update. 
• test 1 | a52@a.com 
• test 2 | a52@a.com 
• test 3 | a52@a.com 
• test4 1 a52@a.com 
test 5 1 a52@a.com 
Elements Console 
Q Search (text 
App 
HeaderComp 
arouserRouter 
Router 
Navigation.provider 
Location.provider 
Routes 
Route. Provider 
List Items 
Footer-comp 
Components 
Listltems 
props 
searchlnput : 
new entry : 
Books 
Profiler 
Sou 
undef 
State (error) : null 
State(isLoaded) : 
true 
State(itens): 
Effect: f {l- 
rendered by 
cresteRoot() 
react dor@1s.e.e-rc.e-f2sssdf4S-2e

 

 

With latest new version (4.22.0) of React developer tool, having some exciting feature:

  • Now you see state name with component tab, earlier that was not available:

Elem ents Console 
Search (text 
HeaderComp 
BrowserRouter 
Router 
Navigation.provider 
Location.provider 
Routes 
Route. Provider 
Listltems 
Footer-comp 
Components 
Listltems 
props 
searchlnput : 
new entry : 
Books 
Profiler 
undef 
State (error) : null 
2 State(isLoaded): true 
State(itens): 
4 Effect: f {l- 
rendered by 
cresteRoot() 
react dom@1S.e.e-rc.e-f2sSSdf4S

  • With "Profiler" tab, now we have new option i.e. "Timeline" which help you to analyse your page load time in parts like how much time it took in API call, how much network time, how much render time etc..

To use react profiler timeline:

  • Open a website that's built with the React (version 18 or newer).
  • Open the "Performance" tab in Chrome and record some performance data.
  • Click the "Save profile..." button in Chrome to export the data.
  • Import the data into the profiler

 

I am recording page performance. I simply opened my one of the react page and then from chrome developer tool(F12), Performance tab, start the recording and then did actions on page like used search button click event to search and load content on page and then stop recording and saved the generated recording profile (fyi - this got auto downloaded as json file).

C localhost:3000/ListltemFilterButtonClick 
s IS ea er area. 
ome I UserForm I SignupForm + Userld() I Listltems+8atching I SuspenseListltems I SuspenseDemaFakeData I ListltemFilterlJseTransition I ListltemFilter8uttanClicklJseTransil 
tchingFunEventStste I TestDemo 
s o er area. 
Elements Console Sources 
Icca-ost 
C) Disable JavaScript samples 
Enable advanced paint instrumentation (slow) 
1 coo n-é 
Network •ost) 
Main — http:,'/IoeIhost:3DDD/ListItemFiIter3uttonCIick 
Summary Bottom -Up Call Tree Event Log 
App component load. 
Networ 
Performance 
eenshots 
Memory 
C) Memory 
Application 
C) Web Vitals 
Security 
scoo 
3705 ms 
Lighthouse 
Components 
Network: No throttling 
CPU: No throttling 
Profiler 
3720 ms 
3710ms 
3715ms 
axe DevTooIs 
3720 ms 
3725

 

Now moved to "Profiler" tab, Timeline sub tab option and imported the above downloaded profile and then see the timeline of each different sections of the page, like after button click, it took some time to render then it call one of API which took 2 second etc.

C localhost:3000/ListltemFilterButtonClick 
IS IS ea er area. 
tome I UserForm I SignupForm + Userld() I Listltems+8atching I SuspenseListltems I SuspenseDemaFakeData I ListltemFilterlJseTransition I ListltemFilter8uttanClickUseTra 
EatchingFunEventStste I TestDemo 
App component load. 
IS IS o er area. 
Elem ents 
disp. 
Console Sources 
Flamegraph 
3120m, 
Network 
Ran ked 
3140,-Æ 
Performance 
Timeline 
Memory 
Application 
318Dn-,s 
Security 
Lighthouse 
Components 
2220m: 
Profiler 
axe DevTooIs 
2s 
http%'/IocaIhost44358/api/fiIedata/getaI

 

 

Categories/Tags: react developer tool

Recent Articles

1

AWS Saving Plan - Cost optimization tips

2
3

AWS RDS Key Concepts & Why you should use it?

4
5

Open-Search/Kibana - Multi Tenancy Setup

See All Articles