diff --git a/packages/block-library/src/post-terms/use-post-terms.js b/packages/block-library/src/post-terms/use-post-terms.js index 2d0aca51db1620..ed22df9a9728b0 100644 --- a/packages/block-library/src/post-terms/use-post-terms.js +++ b/packages/block-library/src/post-terms/use-post-terms.js @@ -4,6 +4,8 @@ import { store as coreStore } from '@wordpress/core-data'; import { useSelect } from '@wordpress/data'; +const EMPTY_ARRAY = []; + export default function usePostTerms( { postId, term } ) { const { slug } = term; @@ -12,8 +14,8 @@ export default function usePostTerms( { postId, term } ) { const visible = term?.visibility?.publicly_queryable; if ( ! visible ) { return { - postTerms: [], - _isLoading: false, + postTerms: EMPTY_ARRAY, + isLoading: false, hasPostTerms: false, }; }