diff --git a/packages/block-library/src/navigation/edit/use-navigation-notice.js b/packages/block-library/src/navigation/edit/use-navigation-notice.js index 2466c79c2e7d51..ad0c6d33587c92 100644 --- a/packages/block-library/src/navigation/edit/use-navigation-notice.js +++ b/packages/block-library/src/navigation/edit/use-navigation-notice.js @@ -5,19 +5,19 @@ import { useRef } from '@wordpress/element'; import { useDispatch } from '@wordpress/data'; import { store as noticeStore } from '@wordpress/notices'; -function useNavigationNotice( { name, message } = {} ) { +function useNavigationNotice( { name, message = '' } = {} ) { const noticeRef = useRef(); const { createWarningNotice, removeNotice } = useDispatch( noticeStore ); - const showNotice = () => { + const showNotice = ( customMsg ) => { if ( noticeRef.current ) { return; } noticeRef.current = name; - createWarningNotice( message, { + createWarningNotice( customMsg || message, { id: noticeRef.current, type: 'snackbar', } );