We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a559922 commit 7eee65bCopy full SHA for 7eee65b
src/index.tsx
@@ -1,4 +1,6 @@
1
-import './wdyr';
+if (import.meta.env.DEV) {
2
+ import.meta.glob('./wdyr.ts', { eager: true });
3
+}
4
import React from 'react';
5
import { createRoot } from 'react-dom/client';
6
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
src/wdyr.ts
@@ -1,10 +1,7 @@
+import whyDidYouRender from '@welldone-software/why-did-you-render';
-if (import.meta.env.DEV) {
- const { default: whyDidYouRender } = await import('@welldone-software/why-did-you-render');
-
- whyDidYouRender(React, {
7
- trackHooks: true,
8
- trackAllPureComponents: true,
9
- });
10
-}
+whyDidYouRender(React, {
+ trackHooks: true,
+ trackAllPureComponents: true,
+});
0 commit comments