fix: wcadmin react18 createroot print shipping banner (#48831)

Co-authored-by: André Kallehauge <3846700+kallehauge@users.noreply.github.com>
This commit is contained in:
RJ 2024-08-09 23:57:24 +08:00 committed by GitHub
parent 3425a2c017
commit e770aef3fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { render } from '@wordpress/element';
import { createRoot } from '@wordpress/element';
import { withPluginsHydration } from '@woocommerce/data';
/**
@ -19,4 +19,7 @@ const HydratedShippingBanner = withPluginsHydration( {
...getAdminSetting( 'plugins' ),
jetpackStatus: getAdminSetting( 'dataEndpoints', {} ).jetpackStatus,
} )( ShippingBanner );
render( <HydratedShippingBanner itemsCount={ args.items } />, metaBox );
createRoot( metaBox ).render(
<HydratedShippingBanner itemsCount={ args.items } />
);

View File

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