fix: wcadmin react18 createroot wc addon tour (#48833)

alpha

alpha
This commit is contained in:
RJ 2024-08-19 19:52:24 +08:00 committed by GitHub
parent 85e7bb0a0c
commit 15e9dd6b25
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,9 @@
/**
* External dependencies
*/
import { render } from '@wordpress/element';
// @ts-expect-error -- @wordpress/element doesn't export createRoot until WP6.2
// eslint-disable-next-line @woocommerce/dependency-group
import { createRoot } from '@wordpress/element';
/**
* Internal dependencies
@ -10,4 +12,5 @@ import WCAddonsTour from '../../guided-tours/wc-addons-tour/index';
const root = document.createElement( 'div' );
root.setAttribute( 'id', 'wc-addons-tour-root' );
render( <WCAddonsTour />, document.body.appendChild( root ) );
createRoot( document.body.appendChild( root ) ).render( <WCAddonsTour /> );

View File

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