Moves the app to TanStack Start with prerendering
Every page is now built as HTML from sitePages.ts, with a catch-all route for 404.html. Hooks that read the browser during render are safe for prerendering. The script step that keeps the CSP intact follows, so this build still has inline scripts and is not deployable yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { useSyncExternalStore } from 'react';
|
||||
|
||||
const subscribeNoop = () => () => {};
|
||||
|
||||
// False while prerendering and during the hydrating render, true afterwards
|
||||
// (and at once for components that mount later). Same behaviour as the
|
||||
// useHydrated that the router keeps internally.
|
||||
export default function useHydrated() {
|
||||
return useSyncExternalStore(
|
||||
subscribeNoop,
|
||||
() => true,
|
||||
() => false,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user