diff --git a/packages/block-library/src/block/edit.js b/packages/block-library/src/block/edit.js index 71940c0dc387c..8e18277836ee2 100644 --- a/packages/block-library/src/block/edit.js +++ b/packages/block-library/src/block/edit.js @@ -14,7 +14,7 @@ import { import { parse, serialize } from '@wordpress/blocks'; import { Placeholder, Spinner, Disabled } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; -import { useEffect, useState } from '@wordpress/element'; +import { useLayoutEffect, useState } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; /** @@ -103,7 +103,7 @@ export default function ReusableBlockEdit( { reusableBlock && isEditing ? blocks : null ); - useEffect( () => { + useLayoutEffect( () => { if ( ! reusableBlock ) { fetchReusableBlock(); }