C-React is an open-source tool that visualizes DOM components as a tree, marks rendering patterns on web pages, and displays performance metrics.
- Install
creact-visualizer
via NPM:
npm install creact-visualizer
- Import
cRender
into your root file:
import cRender from 'creact-visualizer';
- Render your root component using the
cRender
:
import React from 'react';
import App from './App';
import cRender from 'creact-visualizer';
const root = document.getElementById('root');
cRender(
<React.StrictMode>
<App />
</React.StrictMode>,
root
);
-
Open your React application, or any website
-
Open Chrome Developer Tools and click on the C-React panel
-
Watch the tree update dynamically as you navigate through your web page
-
Click on tree nodes to see corresponding element highlighted on your web page, if using our custom renderer
-
Clone this repo onto your local machine
-
Go to Chrome Extensions for manual installation (chrome://extensions/)
-
Click on Load unpacked
-
Select react-visualizer/chrome-extension/build/ to load this extension