Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fill in serverside theme when no client preference is set
  • Loading branch information
regalijan committed Oct 19, 2023
1 parent 969fab8 commit f298775
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/root.tsx
Expand Up @@ -13,7 +13,6 @@ import globalStyles from "../index.css";
import {
isRouteErrorResponse,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
Expand Down Expand Up @@ -148,15 +147,16 @@ function getMarkup(
<StrictMode>
<ChakraProvider
colorModeManager={cookieStorageManagerSSR(
typeof document === "undefined" ? "" : document.cookie
typeof document === "undefined"
? `chakra-ui-color-mode=${loaderData.theme}`
: document.cookie
)}
theme={theme}
>
<div className="App">
<Navigation {...loaderData} />
{children}
<Scripts />
<LiveReload />
</div>
</ChakraProvider>
</StrictMode>
Expand Down

0 comments on commit f298775

Please sign in to comment.