15 lines
380 B
TypeScript
15 lines
380 B
TypeScript
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
import App from './App';
|
|
import './index.css';
|
|
import './hooks/usePlausible';
|
|
|
|
const container = document.getElementById('root');
|
|
if (!container) {
|
|
throw new Error('Root element not found');
|
|
}
|
|
|
|
if (container.children.length > 0) {
|
|
hydrateRoot(container, <App />);
|
|
} else {
|
|
createRoot(container).render(<App />);
|
|
}
|