SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
f59fbe2 verified
Raw History Blame Contribute Delete
767 Bytes
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import App from "./App";
function syncTheme() {
const isDark = document.body.classList.contains("vscode-dark");
document.documentElement.classList.toggle("dark", isDark);
}
syncTheme();
const observer = new MutationObserver(syncTheme);
observer.observe(document.body, {
attributes: true,
attributeFilter: ["class"],
});
const container = document.getElementById("root");
const queryClient = new QueryClient();
if (container) {
createRoot(container).render(
<StrictMode>
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</StrictMode>,
);
}