mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-09 22:09:07 +01:00
fix: add missing unstable_setRequestLocale to enable static rendering
This commit is contained in:
parent
c094b37bca
commit
ceeeb2f9c5
@ -3,10 +3,13 @@ import { notFound } from "next/navigation"
|
||||
|
||||
import { getBlogPostBySlug, getBlogPosts } from "@repo/blog"
|
||||
import { BlogPostUI } from "@repo/blog/BlogPostUI"
|
||||
import type { Locale } from "@repo/i18n/config"
|
||||
import { unstable_setRequestLocale } from "next-intl/server"
|
||||
|
||||
interface BlogPostPageProps {
|
||||
params: {
|
||||
slug: string
|
||||
locale: Locale
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,6 +50,9 @@ export const generateStaticParams = async (): Promise<
|
||||
const BlogPostPage: React.FC<BlogPostPageProps> = async (props) => {
|
||||
const { params } = props
|
||||
|
||||
// Enable static rendering
|
||||
unstable_setRequestLocale(params.locale)
|
||||
|
||||
const blogPost = await getBlogPostBySlug(params.slug)
|
||||
if (blogPost == null) {
|
||||
return notFound()
|
||||
|
Loading…
Reference in New Issue
Block a user