Files
ai-app-skr/index.tsx
2025-11-23 22:02:04 +08:00

40 lines
919 B
TypeScript

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import { ErrorBoundary } from './components/ErrorBoundary';
const rootElement = document.getElementById('root');
if (!rootElement) {
throw new Error("Could not find root element to mount to");
}
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<ErrorBoundary>
<App />
</ErrorBoundary>
</React.StrictMode>
);
// Remove the preloader when everything is loaded
const removeLoader = () => {
const loader = document.getElementById('app-loader');
if (loader) {
// Add fade out effect
loader.style.opacity = '0';
// Remove from DOM after transition
setTimeout(() => {
loader.remove();
}, 500);
}
};
// Check if already loaded
if (document.readyState === 'complete') {
removeLoader();
} else {
window.addEventListener('load', removeLoader);
}