Fix: `useEditorBlocks` hook always returns an array (#41874)
* fix: useEditorBlocks hook always returns an array * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
4467715546
commit
be79b9864e
|
@ -34,10 +34,10 @@ export const useEditorBlocks = (): [
|
|||
|
||||
// @ts-ignore Types are not up to date.
|
||||
const [ blocks, onInput, onChange ]: [
|
||||
BlockInstance[],
|
||||
BlockInstance[] | undefined,
|
||||
ChangeHandler,
|
||||
ChangeHandler
|
||||
] = useEntityBlockEditor( 'postType', templateType );
|
||||
|
||||
return [ blocks, onInput, onChange ];
|
||||
return [ blocks ?? [], onInput, onChange ];
|
||||
};
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix: `useEditorBlocks` hook always returns an array.
|
Loading…
Reference in New Issue