-
Notifications
You must be signed in to change notification settings - Fork 1
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/fix ssg ssr init #172
base: main
Are you sure you want to change the base?
Fix/fix ssg ssr init #172
Conversation
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
|
||
return { | ||
status: parsedParams.data.status, | ||
dehydratedState: ssg.dehydrate(), | ||
i18n, |
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.
it means that this page never needed the dehydrated state?
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.
there is a difference between passing prop and dehydratedState
when we pass a dehydratedState or initialData to query, it does not run request on the client side and query status is success
immediately. When we pass it as prop, query will run again on client side.
I intentionally did not use initialData
here, because in some cases we need to run query one more time on the client side. (for instance for ssg pages when user has lang other than en
)
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.
you will have merge conflict here. layout is deleted in main branch. I merged layout.tsx and page.tsx in a PR that was merged.
@@ -108,7 +109,7 @@ const CustomI18nextProvider = (props: AppPropsWithoutNonce) => { | |||
}, [locale]); | |||
|
|||
const clientViewerI18n = useViewerI18n(locale); | |||
const i18n = clientViewerI18n.data?.i18n; | |||
const i18n = clientViewerI18n.data?.i18n ?? props.pageProps.i18n; |
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.
what was the issue here?
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.
we allow passing i18n as prop. other alternative is to pass it in dehydratedState, but in this case we will have to use createProxySSGHelpers
which requires trpc router.
9588841
to
681b096
Compare
681b096
to
b4bf137
Compare
This PR is being marked as stale due to inactivity. |
What does this PR do?
Fixes # (issue)
Requirement/Documentation
Type of change
How should this be tested?
Mandatory Tasks
Checklist