[Type] Developer Documentation - Fix removeAllNotices dispatch on the removeAllNotices doc section of @wordpress/notices #57436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR replaces the missed
removeNotices
fromuseDispatch( noticesStore )
with theremoveAllNotices
on the removeAllNotices section of the Gutenberg Reference Guide of the @wordpress/notices package.Why?
The Usage example of the
removeAllNotices
section has a bug that prevents the code from working properly. It dispatches theremoveNotices
fromnoticesStore
but it tries to use theremoveAllNotices()
method when clicking on the buttons below.It seems that this
removeAllNotices
section was copied from theremoveNotices
section, but it missed replacing all the occurrences of theremoveNotices
method.How?
It just replaces the
removeNotices
withremoveAllNotices
on the removeAllNotices doc section.Testing Instructions
Not relevant as it doesn't change any working code.
But if you want to test the provided example, you must copy the code and paste it into a new React component, then, import it to be used in a React page (e.g. a WordPress admin page).
Testing Instructions for Keyboard
Not relevant
Screenshots or screencast