Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
/**
|
|
* External dependencies
|
|
*/
|
|
import { createPortal, findDOMNode, flushSync, render, hydrate, unmountComponentAtNode } from 'react-dom';
|
|
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
|
|
/**
|
|
* Creates a portal into which a component can be rendered.
|
|
*
|
|
* @see https://github.com/facebook/react/issues/10309#issuecomment-318433235
|
|
*
|
|
* @param {import('react').ReactElement} child Any renderable child, such as an element,
|
|
* string, or fragment.
|
|
* @param {HTMLElement} container DOM node into which element should be rendered.
|
|
*/
|
|
export { createPortal };
|
|
|
|
/**
|
|
* Finds the dom node of a React component.
|
|
*
|
|
* @param {import('react').ComponentType} component Component's instance.
|
|
*/
|
|
export { findDOMNode };
|
|
|
|
/**
|
|
* Forces React to flush any updates inside the provided callback synchronously.
|
|
*
|
|
* @param {Function} callback Callback to run synchronously.
|
|
*/
|
|
export { flushSync };
|
|
|
|
/**
|
|
* Renders a given element into the target DOM node.
|
|
*
|
|
* @deprecated since WordPress 6.2.0. Use `createRoot` instead.
|
|
* @see https://react.dev/reference/react-dom/render
|
|
*/
|
|
export { render };
|
|
|
|
/**
|
|
* Hydrates a given element into the target DOM node.
|
|
*
|
|
* @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.
|
|
* @see https://react.dev/reference/react-dom/hydrate
|
|
*/
|
|
export { hydrate };
|
|
|
|
/**
|
|
* Creates a new React root for the target DOM node.
|
|
*
|
|
* @since 6.2.0 Introduced in WordPress core.
|
|
* @see https://react.dev/reference/react-dom/client/createRoot
|
|
*/
|
|
export { createRoot };
|
|
|
|
/**
|
|
* Creates a new React root for the target DOM node and hydrates it with a pre-generated markup.
|
|
*
|
|
* @since 6.2.0 Introduced in WordPress core.
|
|
* @see https://react.dev/reference/react-dom/client/hydrateRoot
|
|
*/
|
|
export { hydrateRoot };
|
|
|
|
/**
|
|
* Removes any mounted element from the target DOM node.
|
|
*
|
|
* @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.
|
|
* @see https://react.dev/reference/react-dom/unmountComponentAtNode
|
|
*/
|
|
export { unmountComponentAtNode };
|
|
//# sourceMappingURL=react-platform.js.map
|