Skip to content

Commit

Permalink
enable whyDidYouRender
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed May 18, 2024
1 parent 3deca2b commit a30342e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ dayjs.extend(localizedFormat);
dayjs.extend(relativeTime);
dayjs.extend(utc);
dayjs.locale(locale.toLowerCase());
// 用于检测是什么导致 re-render
// if (process.env.NODE_ENV === 'development') {
// const whyDidYouRender = require('@welldone-software/why-did-you-render');
// whyDidYouRender(React, { trackAllPureComponents: true });
// }
if (false && process.env.NODE_ENV === 'development') {
// 用于检测是什么导致 re-render
const {default: whyDidYouRender} = await import('@welldone-software/why-did-you-render');
whyDidYouRender(React, { trackAllPureComponents: true });
}
// 将 Cookie 中 token 恢复到 Store
const cookieToken = getToken();
if (cookieToken) {
Expand Down

0 comments on commit a30342e

Please sign in to comment.