Skip to content
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

fix: create a component tree that matches between client and server to avoid useId output mismatch #371

Merged
merged 11 commits into from
Jan 19, 2025
Prev Previous commit
Next Next commit
refactor: define correct type inside of casting
marcalexiei committed Jan 19, 2025
commit 1275cf6f73bfc3b14f21113e2c4a92adeb55583f
2 changes: 1 addition & 1 deletion packages/tuono-router/src/components/RouterContext.tsx
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ export function RouterContextProvider({
() => ({
serverSideProps: isServerSide
? serverSideProps
: (window.__TUONO_SSR_PROPS__ as ServerProps),
: window.__TUONO_SSR_PROPS__,
router,
location,
updateLocation: setLocation,
5 changes: 2 additions & 3 deletions packages/tuono-router/src/globals.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { Router } from './router'
import type { ServerProps } from './types'

declare global {
interface Window {
__TUONO__ROUTER__: Router
__TUONO_SSR_PROPS__?: {
props?: unknown
}
__TUONO_SSR_PROPS__?: ServerProps
}
}