-
Notifications
You must be signed in to change notification settings - Fork 2
fix: GitHub stars shows [object Response] when toggling list/grid view #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { createRootRoute, HeadContent, Scripts } from "@tanstack/react-router"; | ||
| import { createRootRoute, HeadContent, Outlet, Scripts } from "@tanstack/react-router"; | ||
| import Footer from "../components/Footer"; | ||
| import Header from "../components/Header"; | ||
| import JsonLd from "../components/JsonLd"; | ||
|
|
@@ -51,11 +51,11 @@ export const Route = createRootRoute({ | |
| ], | ||
| scripts: [{ src: "/theme-init.js" }], | ||
| }), | ||
| shellComponent: RootDocument, | ||
| shellComponent: RootShell, | ||
| component: RootLayout, | ||
| }); | ||
|
|
||
| function RootDocument({ children }: { children: React.ReactNode }) { | ||
| const stars = Route.useLoaderData(); | ||
| function RootShell({ children }: { children: React.ReactNode }) { | ||
| return ( | ||
| <html | ||
| lang="en" | ||
|
|
@@ -66,14 +66,23 @@ function RootDocument({ children }: { children: React.ReactNode }) { | |
| <head> | ||
| <HeadContent /> | ||
| </head> | ||
| <body className="flex min-h-screen flex-col font-sans antialiased [overflow-wrap:anywhere] selection:bg-[rgba(253,54,110,0.2)]"> | ||
| <body className="flex min-h-screen flex-col font-sans antialiased wrap-anywhere selection:bg-[rgba(253,54,110,0.2)]"> | ||
| <JsonLd data={WEBSITE_JSON_LD} /> | ||
| <PlausibleAnalytics /> | ||
| <Header stars={stars} /> | ||
| {children} | ||
| <Footer /> | ||
| <Scripts /> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } | ||
|
|
||
| function RootLayout() { | ||
| const stars = Route.useLoaderData(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks! it works perfectly on my side locally. if it still doesn't work on preview, maybe we can try:
|
||
| return ( | ||
| <> | ||
| <Header stars={stars} /> | ||
| <Outlet /> | ||
| <Footer /> | ||
| </> | ||
| ); | ||
| } | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[overflow-wrap:anywhere]andwrap-anywhereare equivalent canonical classes, no style change.