PluginProbe
Ultimate Markdown – Markdown Editor, Importer, & Exporter / trunk
Ultimate Markdown – Markdown Editor, Importer, & Exporter vtrunk
1.26 trunk 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25
ultimate-markdown / admin / react / options-menu / src / index.js

index.js in Ultimate Markdown – Markdown Editor, Importer, & Exporter trunk, at admin/react/options-menu/src/index.js

22 lines 563 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const {render} = wp.element; //we are using wp.element here!
2 const {createRoot} = wp.element; //we are using wp.element here!
3 import App from './App';
4
5 const domElement = document.getElementById('react-root');
6 const uiElement = <App/>;
7
8 //check if element exists before rendering
9 if (domElement) {
10
11 /**
12 * Use the proper render method depending on the React version (which depends
13 * on the WP version)
14 */
15 if ( createRoot ) {
16 createRoot( domElement ).render( uiElement );
17 } else {
18 render( uiElement, domElement );
19 }
20
21 }
22