Remove createRoot from App component and export App only

cgen-23993868eff84b468bd514bbed828e5d
This commit is contained in:
Builder.io 2025-08-06 02:23:57 +00:00
parent 3b2f04b68b
commit 0f93d4c208
2 changed files with 16 additions and 1 deletions

View file

@ -111,4 +111,4 @@ const App = () => (
</QueryClientProvider>
);
createRoot(document.getElementById("root")!).render(<App />);
export default App;

15
client/main.tsx Normal file
View file

@ -0,0 +1,15 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
const container = document.getElementById('root');
if (!container) {
throw new Error('Root element not found');
}
const root = createRoot(container);
root.render(
<StrictMode>
<App />
</StrictMode>
);