TanStackT
TanStack11mo ago
53 replies
awake-maroon

Dark Mode

Has anyone created the Theme Provider ShadCN suggests for the "Vite" solution? Where did you wrap?

I tried wrapping..

function RootComponent() {
  return (
    <ThemeProvider defaultTheme="dark" storageKey="vite-ui-theme">
      <RootDocument>
        <Outlet />
      </RootDocument>
    </ThemeProvider>
  );
}


and it threw an error that localStorage is not defined. I believe this is because it was running on the server?
Was this page helpful?