fix: wcadmin react18 createroot marketing coupons (#48832)

Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
This commit is contained in:
RJ 2024-08-09 21:13:56 +08:00 committed by GitHub
parent 70e54f90ca
commit 90b835478b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { render } from '@wordpress/element';
import { createRoot } from '@wordpress/element';
/**
* Internal dependencies
@ -13,9 +13,7 @@ const postForm = document.getElementById( 'posts-filter' );
if ( postForm ) {
const couponRoot = document.createElement( 'div' );
couponRoot.setAttribute( 'id', 'coupon-root' );
render(
<CouponsOverview />,
postForm.parentNode.appendChild( couponRoot )
createRoot( postForm.parentNode.appendChild( couponRoot ) ).render(
<CouponsOverview />
);
}

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Changed from using React.render to React.createRoot for marketing coupons as it has been deprecated since React 18