diff --git a/packages/editor/README.md b/packages/editor/README.md
index 2acb98ef13642..bcd1727e046d0 100644
--- a/packages/editor/README.md
+++ b/packages/editor/README.md
@@ -878,9 +878,9 @@ function onPreviewClick() {
}
const ExternalPreviewMenuItem = () => (
-
+
{ __( 'Preview in new tab' ) }
-
+
);
registerPlugin( 'external-preview-menu-item', {
render: ExternalPreviewMenuItem,
diff --git a/packages/editor/src/components/plugin-preview-menu-item/index.js b/packages/editor/src/components/plugin-preview-menu-item/index.js
index 422248e17b88e..8038da04595aa 100644
--- a/packages/editor/src/components/plugin-preview-menu-item/index.js
+++ b/packages/editor/src/components/plugin-preview-menu-item/index.js
@@ -1,9 +1,8 @@
/**
* WordPress dependencies
*/
-import { compose } from '@wordpress/compose';
import { MenuItem } from '@wordpress/components';
-import { withPluginContext } from '@wordpress/plugins';
+import { usePluginContext } from '@wordpress/plugins';
import { ActionItem } from '@wordpress/interface';
/**
@@ -27,12 +26,12 @@ import { ActionItem } from '@wordpress/interface';
* }
*
* const ExternalPreviewMenuItem = () => (
- *
* { __( 'Preview in new tab' ) }
- *
+ *
* );
* registerPlugin( 'external-preview-menu-item', {
* render: ExternalPreviewMenuItem,
@@ -41,12 +40,14 @@ import { ActionItem } from '@wordpress/interface';
*
* @return {Component} The rendered menu item component.
*/
-export default compose(
- withPluginContext( ( context, ownProps ) => {
- return {
- as: ownProps.as ?? MenuItem,
- icon: ownProps.icon || context.icon,
- name: 'core/plugin-preview-menu',
- };
- } )
-)( ActionItem );
+export default function PluginPreviewMenuItem( props ) {
+ const context = usePluginContext();
+ return (
+
+ );
+}