Skip to content

Commit

Permalink
Style Book: Fix React Compiler error (#66445)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent 8fab6dd commit 351e092
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/edit-site/src/components/style-book/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,20 @@ function StyleBook( {
( select ) => select( blockEditorStore ).getSettings(),
[]
);
const [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );

const settings = useMemo(
() => ( {
...originalSettings,
styles:
! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )
? globalStyles
: originalSettings.styles,
isPreviewMode: true,
} ),
[ originalSettings ]
[ globalStyles, originalSettings, userConfig ]
);

const [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );

settings.styles =
! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )
? globalStyles
: settings.styles;

return (
<EditorCanvasContainer
onClose={ onClose }
Expand Down

0 comments on commit 351e092

Please sign in to comment.