mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Make "why-did-you-render" a dynamic import (#53121)
This commit is contained in:
parent
f1295e4bd0
commit
c2d3b45bf4
@ -1,9 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export function initDevFeatures() {
|
export async function initDevFeatures() {
|
||||||
// if why-render is in url enable why did you render react extension
|
// if why-render is in url enable why did you render react extension
|
||||||
if (window.location.search.indexOf('why-render') !== -1) {
|
if (window.location.search.indexOf('why-render') !== -1) {
|
||||||
const whyDidYouRender = require('@welldone-software/why-did-you-render');
|
const { default: whyDidYouRender } = await import('@welldone-software/why-did-you-render');
|
||||||
whyDidYouRender(React, {
|
whyDidYouRender(React, {
|
||||||
trackAllPureComponents: true,
|
trackAllPureComponents: true,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user