Skip to content

Commit

Permalink
Update __root.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Nov 21, 2024
1 parent 2125a2e commit 65f50fa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tanstack-start/app/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ export const Route = createRootRoute({
),
loaderDeps: ({search: {lastLiveEventId}}) => ({lastLiveEventId}),
loader: ({deps}) => getTheme({data: deps}),
head: ({loaderData}) => ({
head: () => ({
meta: [
{charSet: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{title: 'TanStack Start Starter'},
{name: 'theme-color', content: loaderData?.data?.background || '#000'},
],
links: [
{rel: 'stylesheet', href: appCss},
Expand Down Expand Up @@ -70,6 +69,8 @@ function RootDocument({children}: Readonly<{children: ReactNode}>) {
>
<head>
<Meta />
{/* iOS Safari struggles with picking up on changes to this tag */}
<meta key={data?.background} name="theme-color" content={data?.background || '#000'} />
</head>
<body>
{children}
Expand Down

0 comments on commit 65f50fa

Please sign in to comment.