Skip to content

Commit

Permalink
Add missing dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Apr 13, 2023
1 parent 3034ac4 commit e51184c
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import { useSelect } from '@wordpress/data';
import { store as blockEditorStore } from '../../store';

const CreateNewPostLink = ( { clientId } ) => {
const postType = useSelect( ( select ) => {
const { getBlockAttributes } = select( blockEditorStore );
return getBlockAttributes( clientId )?.query?.postType;
} );
const postType = useSelect(
( select ) => {
const { getBlockAttributes } = select( blockEditorStore );
return getBlockAttributes( clientId )?.query?.postType;
},
[ clientId ]
);

if ( ! postType ) return null;
const newPostUrl = addQueryArgs( 'post-new.php', {
Expand Down

0 comments on commit e51184c

Please sign in to comment.