Fix wcadmin-product-usage-notice-modal react18 createroot (#50765)

This commit is contained in:
Akeda Bagus 2024-08-20 11:50:26 +07:00 committed by GitHub
parent 6a9da36388
commit 403d78ae22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
/** /**
* External dependencies * External dependencies
*/ */
import { render } from '@wordpress/element'; import { createRoot } from '@wordpress/element';
/** /**
* Internal dependencies * Internal dependencies
@ -27,7 +27,7 @@ const {
const container = document.createElement( 'div' ); const container = document.createElement( 'div' );
container.setAttribute( 'id', 'woo-product-usage-notice' ); container.setAttribute( 'id', 'woo-product-usage-notice' );
render( createRoot( document.body.appendChild( container ) ).render(
<ProductUsageNoticeModal <ProductUsageNoticeModal
renewUrl={ renewUrl } renewUrl={ renewUrl }
subscribeUrl={ subscribeUrl } subscribeUrl={ subscribeUrl }
@ -41,6 +41,5 @@ render(
colorScheme={ colorScheme } colorScheme={ colorScheme }
subscriptionState={ subscriptionState } subscriptionState={ subscriptionState }
screenId={ screenId } screenId={ screenId }
/>, />
document.body.appendChild( container )
); );

View File

@ -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