fix: wcadmin react18 createroot marketing coupons (#48832)
Co-authored-by: Gan Eng Chin <ecgan@users.noreply.github.com>
This commit is contained in:
parent
70e54f90ca
commit
90b835478b
|
@ -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 />
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue