{{={= =}=}} import { StrictMode, type ReactNode } from "react"; import { useIsClient } from "./hooks/useIsClient.js" export function Layout({ children, isFallbackPage = false, clientEntrySrc, }: { children?: ReactNode; isFallbackPage?: boolean; clientEntrySrc?: string; }) { const isClient = useIsClient() /* From the Vite SSR plugin, we inherit the concept of a "prerendered page" vs. a "fallback page". - A prerendered page is a page that is rendered on the server, and then hydrated on the client. - A fallback page is a page which only prerenders the common HTML structure on the server, and then renders the actual page content on the client. To use an analogy, a fallback page is a pluripotent stem cell that can turn into any page in the client; while a prerendered page is already specialized and can only render its specific content. So, if we are prerendering a fallback page, we want to avoid rendering the actual page content, so that it can turn into anything. If we're prerendering a non-fallback page, we'll give it its content. But, if we're already in the client, we always want to render the page content. Whether prerendered as a fallback or not, now it's showtime, so we must show the user the content. Thus, we end up with the line below: */ const shouldRenderChildren = isClient || !isFallbackPage return ( {=& head =} {= title =} { // We pass that argument in SSR builds and not in client builds. // This would usually cause a hydration mismatch, but React has an // exception for `