-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tsx
More file actions
23 lines (20 loc) · 702 Bytes
/
main.tsx
File metadata and controls
23 lines (20 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import "./main.css";
// Get the window label
const windowLabel = document.querySelector('meta[name="tauri-window"]')?.getAttribute("content");
console.log("Window label:", windowLabel);
const rootElement = document.getElementById("root");
console.log("Root element:", rootElement);
// Render different components based on the window
if (windowLabel === "main") {
console.log("Rendering App component");
ReactDOM.createRoot(rootElement as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
} else {
console.log("Not rendering App - window label doesn't match");
}