Updated TypeScript to resolve async RSC error

This commit is contained in:
Henrik Larsson 2023-08-09 14:34:10 +02:00
parent 5e1571e621
commit 336ae78a4b
7 changed files with 1197 additions and 1602 deletions

View File

@ -79,7 +79,6 @@ export default async function Page({ params }: PageParams) {
<>
<DynamicContentManager content={page?.content} />
<Suspense>
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<Footer locale={params.locale} />
</Suspense>
</>

View File

@ -39,7 +39,6 @@ export default async function ProductPage({ params }: CategoryPageParams) {
<div className="mb-8 flex w-full flex-col px-4 lg:my-16 lg:px-8 2xl:px-16">
<Text variant={'pageHeading'}>{title}</Text>
<Suspense>
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<Footer locale={params.locale} />
</Suspense>
</div>

View File

@ -35,7 +35,6 @@ export default async function HomePage({ params }: HomePageParams) {
<>
<DynamicContentManager content={data?.content} />
<Suspense>
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<Footer locale={params.locale} />
</Suspense>
</>

View File

@ -87,7 +87,6 @@ export default async function ProductPage({ params }: ProductPageParams) {
/>
<ProductView product={product} relatedProducts={[]} />
<Suspense>
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<Footer locale={params.locale} />
</Suspense>
</>

View File

@ -31,12 +31,10 @@ const Header = ({ locale }: HeaderProps) => {
</div>
<div className="absolute left-1/2 top-1/2 hidden -translate-x-1/2 -translate-y-1/2 transform md:flex">
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<DesktopMenu locale={locale} />
</div>
<div className="flex justify-end md:w-1/3">
<Suspense fallback={<OpenCart />}>
{/* @ts-expect-error Server Component (https://github.com/vercel/next.js/issues/42292) */}
<Cart />
</Suspense>
</div>

View File

@ -69,6 +69,7 @@
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.2.8",
"tailwindcss": "^3.3.2",
"typescript": "4.9.5"
"typescript": "^5.1.3"
}
}

2790
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff