import React from 'react'; import ReactDOM from 'react-dom/client'; import { App } from './App'; // Find all audit root elements on the page and mount the React app. // In WP, each shortcode renders a unique root div. function mount() { const roots = document.querySelectorAll('.noon-audit-wrapper'); if (roots.length === 0) { console.warn('[Noon Audit] No .noon-audit-wrapper elements found.'); return; } roots.forEach((el) => { const root = ReactDOM.createRoot(el); root.render( ); }); } // Run on DOM ready. if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', mount); } else { mount(); }