Skip to content

Commit

Permalink
refactor: remove whyDidYouRender and lazyload html2canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosoul committed Sep 6, 2020
1 parent 781270a commit 01110c1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
8 changes: 2 additions & 6 deletions src/components/ColorTitle/Poetry.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Poetry = ({
content = '',
author = '',
title = '',
refetch
refetch,
}) => {
const { isMobile } = useMobile();
const handleClick = () => {
Expand All @@ -49,7 +49,7 @@ const Poetry = ({
style={{ background: bgColor, color: fontColor }}
className={isMobile ? 'mobile' : ''}
>
{content.map(line => {
{content.map((line) => {
return (
<p key={line} className="line">
{line}
Expand All @@ -62,9 +62,5 @@ const Poetry = ({
</Wrapper>
);
};
Poetry.whyDidYouRender = {
logOnDifferentValues: true,
customName: 'Poetry'
};

export default Poetry;
4 changes: 0 additions & 4 deletions src/components/ColorTitle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,4 @@ const ColorTitle = ({ name, pinyin, hex, RGB, CMYK, figure }) => {
</Wrapper>
);
};
ColorTitle.whyDidYouRender = {
logOnDifferentValues: true,
customName: 'ColorTitleComp'
};
export default ColorTitle;
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import GlobalStyle from './Global.style';

import register from './registerServiceWorker';

if (process.env.NODE_ENV !== 'production') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React);
}
ReactDOM.render(
<>
<GlobalStyle />
Expand Down
6 changes: 1 addition & 5 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Header = lazy(() => import('../components/Header'));
const IconScreenshot = lazy(() => import('../components/IconScreenshot'));
const ColorSet = lazy(() => import('../components/ColorSet'));
const ICP = lazy(() => import('../components/ICP'));
import Preview from '../components/Preview';
const Preview = lazy(() => import('../components/Preview'));
import InfoModal from '../components/InfoModal';

import { useModal, useColor, usePreview } from '../hooks';
Expand Down Expand Up @@ -108,8 +108,4 @@ const Index = () => {
</Suspense>
);
};
Index.whyDidYouRender = {
logOnDifferentValues: true,
customName: 'IndexPage'
};
export default Index;

0 comments on commit 01110c1

Please sign in to comment.