-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
25 lines (23 loc) · 827 Bytes
/
index.tsx
File metadata and controls
25 lines (23 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* @file index.tsx
* @description This is the main entry point for the React application.
* It finds the root DOM element and renders the main App component into it.
* The React.StrictMode wrapper is used to highlight potential problems in the app during development.
*/
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css'; // Global Tailwind styles
// Find the root HTML element where the React app will be mounted.
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
// Create a React root for the main DOM element.
const root = ReactDOM.createRoot(rootElement);
// Render the main App component.
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);