Skip to content

Commit

Permalink
Pakk inn await og render i async funksjon
Browse files Browse the repository at this point in the history
  • Loading branch information
oddgfa committed Oct 23, 2024
1 parent 79c28b2 commit f27b07f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ if (import.meta.env.DEV) {
};
}

if (import.meta.env.VITE_MOCK_ENABLED === 'true') {
const { worker } = await import('./mock/browser');
await worker.start();
}
(async () => {
if (import.meta.env.VITE_MOCK_ENABLED === 'true') {
const { worker } = await import('./mock/browser');
await worker.start();
}

const container = document.getElementById('root');
const root = createRoot(container!);
const container = document.getElementById('root');
const root = createRoot(container!);

root.render(<AppContainer />);
root.render(<AppContainer />);
})();

0 comments on commit f27b07f

Please sign in to comment.