Skip to content

Commit

Permalink
Return getBlockStyles from the useSelect callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Jun 25, 2024
1 parent fab458f commit d7078b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-editor/src/hooks/block-style-variation.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ function getVariationNameFromClass( className, registeredStyles = [] ) {
* @return {Array} An array of new block variation overrides.
*/
export function useUpdateBlockStyleVariationOverridesWithConfig( config ) {
const overrides = useSelect(
( select ) => unlock( select( blockEditorStore ) ).getStyleOverrides(),
const { getBlockStyles, overrides } = useSelect(
( select ) => ( {
getBlockStyles: select( blocksStore ).getBlockStyles,
overrides: unlock( select( blockEditorStore ) ).getStyleOverrides(),
} ),
[]
);
const { getBlockStyles } = useSelect( blocksStore );
const { getBlockName } = useSelect( blockEditorStore );

return useMemo( () => {
Expand Down

0 comments on commit d7078b5

Please sign in to comment.