diff --git a/plugins/woocommerce-admin/client/wp-admin-scripts/woo-product-usage-notice/index.js b/plugins/woocommerce-admin/client/wp-admin-scripts/woo-product-usage-notice/index.js index dc4e0670e88..ccaab793a41 100644 --- a/plugins/woocommerce-admin/client/wp-admin-scripts/woo-product-usage-notice/index.js +++ b/plugins/woocommerce-admin/client/wp-admin-scripts/woo-product-usage-notice/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { render } from '@wordpress/element'; +import { createRoot } from '@wordpress/element'; /** * Internal dependencies @@ -27,7 +27,7 @@ const { const container = document.createElement( 'div' ); container.setAttribute( 'id', 'woo-product-usage-notice' ); -render( +createRoot( document.body.appendChild( container ) ).render( , - document.body.appendChild( container ) + /> ); diff --git a/plugins/woocommerce/changelog/fix-wcadmin-react18-product-usage-notice-modal b/plugins/woocommerce/changelog/fix-wcadmin-react18-product-usage-notice-modal new file mode 100644 index 00000000000..60ecc7ee16f --- /dev/null +++ b/plugins/woocommerce/changelog/fix-wcadmin-react18-product-usage-notice-modal @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Changed from using React.render to React.createRoot for product-usage-notice-modal as it has been deprecated since React 18