// Use WordPress core's element/React runtime; do not bundle another React in the plugin. import type * as React from 'react'; declare global {interface Window {wp: {element: typeof React & {createRoot?: (node: HTMLElement) => {render: (element: React.ReactNode) => void}; render: (element: React.ReactNode, node: HTMLElement) => void}}}} const element = window.wp.element; export const {useEffect, useRef, useState, createElement, Fragment} = element; export function mount(node: HTMLElement, content: React.ReactNode) {if (element.createRoot) element.createRoot(node).render(content); else element.render(content, node);}