Skip to content

Commit

Permalink
Added React Memo in Skeletons
Browse files Browse the repository at this point in the history
-> Sidebar Skeleton
-> Checkbox Skeleton

Removed console.log() from Live Preview
  • Loading branch information
officiallygod committed Jan 12, 2023
1 parent b5267af commit 9ff7324
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { memo } from '@wordpress/element';

/**
* Checkbox List Skeleton Component
Expand Down Expand Up @@ -35,4 +36,4 @@ const CheckboxListSkeleton = ({ count }) => {
);
};

export default CheckboxListSkeleton;
export default memo(CheckboxListSkeleton);
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ const BlockPreview = ( {
);
});

console.count('Rendered');

return (
<div className={ `live-preview__container-${ styling }` }>
{ loading && <SkeletonLivePreview/> }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { memo } from '@wordpress/element';

/** Skeleton Structure for the SideBar */
const SidebarSkeleton = () => {
return (
Expand Down Expand Up @@ -35,4 +37,4 @@ const SidebarSkeleton = () => {
);
};

export default SidebarSkeleton;
export default memo(SidebarSkeleton);

0 comments on commit 9ff7324

Please sign in to comment.