diff --git a/packages/editor/src/components/editor-history/redo.js b/packages/editor/src/components/editor-history/redo.js index 2e359963bd172..7bfd25a81ba71 100644 --- a/packages/editor/src/components/editor-history/redo.js +++ b/packages/editor/src/components/editor-history/redo.js @@ -3,17 +3,20 @@ */ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; -import { withSelect, withDispatch } from '@wordpress/data'; -import { compose } from '@wordpress/compose'; +import { useSelect, useDispatch } from '@wordpress/data'; import { displayShortcut } from '@wordpress/keycodes'; import { redo as redoIcon } from '@wordpress/icons'; import { forwardRef } from '@wordpress/element'; -function EditorHistoryRedo( { hasRedo, redo, innerRef, ...props } ) { +function EditorHistoryRedo( props, ref ) { + const hasRedo = useSelect( ( select ) => + select( 'core/editor' ).hasEditorRedo() + ); + const { redo } = useDispatch( 'core/editor' ); return (