Browse Source

memolize PageView

Yuki Takei 9 tháng trước cách đây
mục cha
commit
c663f34209
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      apps/app/src/components/PageView/PageView.tsx

+ 2 - 2
apps/app/src/components/PageView/PageView.tsx

@@ -40,7 +40,7 @@ type Props = {
   className?: string,
 }
 
-export const PageView = (props: Props): JSX.Element => {
+export const PageView = React.memo((props: Props): JSX.Element => {
   const renderStartTime = performance.now();
 
   const commentsContainerRef = useRef<HTMLDivElement>(null);
@@ -238,4 +238,4 @@ export const PageView = (props: Props): JSX.Element => {
 
     </PageViewLayout>
   );
-};
+});