Chore: Make "why-did-you-render" a dynamic import (#53121)

This commit is contained in:
kay delaney 2022-08-08 15:33:49 +01:00 committed by GitHub
parent f1295e4bd0
commit c2d3b45bf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,9 @@
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 (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, {
trackAllPureComponents: true,
});