PluginProbe
ZIP AI – AI Website Builder & AI Agent (Beta) / 0.0.4
ZIP AI – AI Website Builder & AI Agent (Beta) v0.0.4
0.0.10 0.0.9 trunk 0.0.4 0.0.5 0.0.6 0.0.7 0.0.8
zip-ai / src / main.jsx

main.jsx in ZIP AI – AI Website Builder & AI Agent (Beta) 0.0.4, at src/main.jsx

26 lines 727 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react';
2 import { createRoot } from 'react-dom/client';
3 import App from './App';
4 import './styles/main.css';
5
6 // Module-level root reference to prevent duplicate createRoot calls
7 let root = null;
8
9 // Skip mounting inside nested iframes (e.g., Gutenberg block canvas,
10 // SureForms shortcode previews that load the frontend in an iframe).
11 const isInIframe = (() => {
12 try { return window.self !== window.top; } catch { return true; }
13 })();
14
15 // Mount React app
16 const container = isInIframe ? null : document.getElementById('chat-assistant-root');
17
18 if (container && !root) {
19 root = createRoot(container);
20 root.render(
21 <React.StrictMode>
22 <App />
23 </React.StrictMode>
24 );
25 }
26