mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Fix vite hot reload
This commit is contained in:
+10
-2
@@ -65,7 +65,13 @@ export const clientSupport = new ApolloClient({
|
||||
cache: new InMemoryCache(),
|
||||
});
|
||||
|
||||
ReactDOMClient.createRoot(document.querySelector('#app') as HTMLElement).render(
|
||||
let root: ReactDOMClient.Root | null = null;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if (!root) {
|
||||
root = ReactDOMClient.createRoot(document.querySelector('#app') as HTMLElement);
|
||||
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<ApolloProvider client={clientMain}>
|
||||
<ThemeProvider theme={theme}>
|
||||
@@ -76,7 +82,9 @@ ReactDOMClient.createRoot(document.querySelector('#app') as HTMLElement).render(
|
||||
</ThemeProvider>
|
||||
</ApolloProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
|
||||
Reference in New Issue
Block a user