Open igorschoester opened 1 year ago
Situation
@wordpress/element
@wordpress/element
is depending on the WordPress versionDependencies (TODO)
Tests are failing (TODO)
nohoist
herePossible solution?
Addons (TODO)
Moved to the most future sprint we currently have, we'll reprise it by then and try to plan a clear timeline
Please inform the customer of conversation # 1054366 when this conversation has been closed.
Issue is still active with latest yoast premium. Any ETA ?
Please inform the customer of conversation # 1103708 when this conversation has been closed.
Was googling for something else and ended up here. If I am reading this correctly I have been supporting both versions like so:
/**
* External dependencies
*/
import { createRoot, render } from '@wordpress/element';
import App from './app';
const target = document.getElementById( 'my-app-root' );
if ( target ) {
if ( createRoot ) {
createRoot( target ).render( <App /> );
} else {
render( <App />, target );
}
}
If createRoot()
exists (like in the newer react) it uses that. If createRoot()
is undefined... it falls back to render()
Hi @helgatheviking
Thanks for the comment and for sharing more details. This issue is on the radar of our development team, and they will prioritize it based on the severity of this problem in relation to other open bug reports and new features.
Still not corrected?
we are on WP 6.6, any updates on this?
⚠️ Since we rely on
@wordpress/element
to exportcreateRoot
-- this issue can not be fixed until WP 6.2 is the last version we support (unless we try both methods) ⚠️In WP 6.2 we get React
18.0.2
instead of17.0.2
.This causes JS console errors to be shown:
This seems to originate in a couple of different places, like the help scout beacon, first time configuration and the settings (not Settings UI).
Reproduce steps
WordPress Beta Tester
pluginBleeding edge
and the stream toBeta/RC Only
6.2-beta1
(at the time of writing)wp-config.php
. Please do this instead of theWP_DEBUG
set tofalse
.