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