forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React: Add why-did-you-render dev extension to better see what compon…
…ents re-render and why (in console) (grafana#23455) * React: Add why-did-you-render dev extension to better understand what components re-renders * Lock version * Updated yarn locj
- Loading branch information
Showing
4 changed files
with
84 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import app from './app'; | ||
import React from 'react'; | ||
|
||
/* | ||
Import theme CSS based on env vars, e.g.: `env GRAFANA_THEME=light yarn start` | ||
*/ | ||
declare var GRAFANA_THEME: any; | ||
require('../sass/grafana.' + GRAFANA_THEME + '.scss'); | ||
|
||
app.init(); | ||
export function initDevFeatures() { | ||
// if why-render is in url enable why did you render react extension | ||
if (window.location.search.indexOf('why-render') !== -1) { | ||
const whyDidYouRender = require('@welldone-software/why-did-you-render'); | ||
whyDidYouRender(React, { | ||
trackAllPureComponents: true, | ||
}); | ||
} | ||
} |
Oops, something went wrong.