From 9ff73242ee997f2d3d6ae6166c88296a62464669 Mon Sep 17 00:00:00 2001 From: Allen Benny Date: Thu, 12 Jan 2023 18:18:25 +0530 Subject: [PATCH] Added React Memo in Skeletons -> Sidebar Skeleton -> Checkbox Skeleton Removed console.log() from Live Preview --- .../components/CheckboxTemplate/CheckboxListSkeleton/index.js | 3 ++- .../components/LivePreview/BlockPreview/index.js | 2 -- .../Sidebar/components/LearnMore/Skeleton/SidebarSkeleton.js | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/index.js b/src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/index.js index 37b9255fc..54e7b0aae 100644 --- a/src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/index.js +++ b/src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/index.js @@ -1,3 +1,4 @@ +import { memo } from '@wordpress/element'; /** * Checkbox List Skeleton Component @@ -35,4 +36,4 @@ const CheckboxListSkeleton = ({ count }) => { ); }; -export default CheckboxListSkeleton; +export default memo(CheckboxListSkeleton); diff --git a/src/OnboardingSPA/components/LivePreview/BlockPreview/index.js b/src/OnboardingSPA/components/LivePreview/BlockPreview/index.js index 6ae00f11d..f17fa5640 100644 --- a/src/OnboardingSPA/components/LivePreview/BlockPreview/index.js +++ b/src/OnboardingSPA/components/LivePreview/BlockPreview/index.js @@ -88,8 +88,6 @@ const BlockPreview = ( { ); }); - console.count('Rendered'); - return (
{ loading && } diff --git a/src/OnboardingSPA/components/Sidebar/components/LearnMore/Skeleton/SidebarSkeleton.js b/src/OnboardingSPA/components/Sidebar/components/LearnMore/Skeleton/SidebarSkeleton.js index ed201d339..3abc89a6a 100644 --- a/src/OnboardingSPA/components/Sidebar/components/LearnMore/Skeleton/SidebarSkeleton.js +++ b/src/OnboardingSPA/components/Sidebar/components/LearnMore/Skeleton/SidebarSkeleton.js @@ -1,3 +1,5 @@ +import { memo } from '@wordpress/element'; + /** Skeleton Structure for the SideBar */ const SidebarSkeleton = () => { return ( @@ -35,4 +37,4 @@ const SidebarSkeleton = () => { ); }; -export default SidebarSkeleton; +export default memo(SidebarSkeleton);