Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/block-editor/src/hooks/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { getBlockSupport } from '@wordpress/blocks';
import { memo, useMemo, useEffect, useId, useState } from '@wordpress/element';
import {
memo,
useMemo,
useEffect,
useLayoutEffect,
useId,
useState,
} from '@wordpress/element';
import { useDispatch, useRegistry } from '@wordpress/data';
import { createHigherOrderComponent } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
Expand Down Expand Up @@ -614,7 +621,7 @@ function BlockProps( {
} );
// Setting state after every render is fine because this component is
// pure and will only re-render when needed props change.
useEffect( () => {
useLayoutEffect( () => {
// We could shallow compare the props, but since this component only
// changes when needed attributes change, the benefit is probably small.
setWrapperProps( wrapperProps );
Expand Down
Loading