Skip to content

Commit

Permalink
Only skip server side rendering of spacing styles
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Feb 9, 2023
1 parent 565e365 commit 041f4de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/block-library/src/latest-comments/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export default function LatestComments( { attributes, setAttributes } ) {
const { commentsToShow, displayAvatar, displayDate, displayExcerpt } =
attributes;

const serverSideAttributes = {
...attributes,
style: {
...attributes?.style,
spacing: undefined,
},
};

return (
<div { ...useBlockProps() }>
<InspectorControls>
Expand Down Expand Up @@ -71,8 +79,7 @@ export default function LatestComments( { attributes, setAttributes } ) {
<Disabled>
<ServerSideRender
block="core/latest-comments"
attributes={ attributes }
skipBlockSupportAttributes
attributes={ serverSideAttributes }
// The preview uses the site's locale to make it more true to how
// the block appears on the frontend. Setting the locale
// explicitly prevents any middleware from setting it to 'user'.
Expand Down

0 comments on commit 041f4de

Please sign in to comment.