blog
This commit is contained in:
@@ -3,15 +3,20 @@ import { blogSingleQueryOptions } from '../hooks/useBlogsData'
|
|||||||
import { NextPage } from 'next'
|
import { NextPage } from 'next'
|
||||||
import SingleBlogPage from '../components/SingleBlogPage'
|
import SingleBlogPage from '../components/SingleBlogPage'
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
interface PageProps {
|
||||||
const SingleBlog: NextPage<any> = async ({ params }) => {
|
params: Promise<{
|
||||||
|
id: string
|
||||||
|
}>
|
||||||
|
}
|
||||||
|
|
||||||
|
const SingleBlog: NextPage<PageProps> = async ({ params }) => {
|
||||||
|
const { id } = await params
|
||||||
|
|
||||||
const queryClient = new QueryClient()
|
const queryClient = new QueryClient()
|
||||||
await queryClient.prefetchQuery(blogSingleQueryOptions(params.id))
|
await queryClient.prefetchQuery(blogSingleQueryOptions(id))
|
||||||
return (
|
return (
|
||||||
<HydrationBoundary state={dehydrate(queryClient)}>
|
<HydrationBoundary state={dehydrate(queryClient)}>
|
||||||
<SingleBlogPage id={params.id} />
|
<SingleBlogPage id={id} />
|
||||||
</HydrationBoundary>
|
</HydrationBoundary>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user