From ef77913eaad2fe479230a9beea1584537581d843 Mon Sep 17 00:00:00 2001 From: haddoumounir <165167690+haddoumounir@users.noreply.github.com> Date: Thu, 26 Mar 2026 23:27:48 +0100 Subject: [PATCH] fix(app-router-playground): resolve React Doctor findings and build warnings --- .../@breadcrumbs/[...all]/page.tsx | 12 +++--- .../app/api/og/route.tsx | 16 ++++--- .../app/context/context-click-counter.tsx | 2 +- .../app/loading/[section]/[category]/page.tsx | 13 +++--- .../app/loading/[section]/page.tsx | 13 +++--- .../_components/product-list.tsx | 5 +-- .../_components/recommendations.tsx | 4 +- .../private-cache/product/[id]/loading.tsx | 4 +- .../product/[id]/with-private/page.tsx | 4 +- .../product/[id]/without-private/page.tsx | 4 +- .../[section]/[category]/page.tsx | 13 +++--- .../ui/click-counter.tsx | 2 +- .../app-router-playground/ui/codehike.tsx | 43 +++++++++++++++---- .../app-router-playground/ui/skeleton.tsx | 13 ++++-- examples/app-router-playground/vite.config.ts | 23 ++++++++++ .../app-router-playground/worker/index.ts | 4 ++ 16 files changed, 118 insertions(+), 57 deletions(-) diff --git a/examples/app-router-playground/app/_patterns/breadcrumbs/@breadcrumbs/[...all]/page.tsx b/examples/app-router-playground/app/_patterns/breadcrumbs/@breadcrumbs/[...all]/page.tsx index d1d2eda8e..76cc419eb 100644 --- a/examples/app-router-playground/app/_patterns/breadcrumbs/@breadcrumbs/[...all]/page.tsx +++ b/examples/app-router-playground/app/_patterns/breadcrumbs/@breadcrumbs/[...all]/page.tsx @@ -9,13 +9,11 @@ export default async function Page({ // Note: you could fetch breadcrumb data based on params here // e.g. title, slug, children/siblings (for dropdowns) - const items = [ - ...all.map((param, index) => ({ - text: param, - // build cumulative path by joining all segments up to current index - href: `/${all.slice(0, index + 1).join('/')}`, - })), - ]; + const items = all.map((param, index) => ({ + text: param, + // build cumulative path by joining all segments up to current index + href: `/${all.slice(0, index + 1).join('/')}`, + })); return ; } diff --git a/examples/app-router-playground/app/api/og/route.tsx b/examples/app-router-playground/app/api/og/route.tsx index da42a44fe..2561a6263 100644 --- a/examples/app-router-playground/app/api/og/route.tsx +++ b/examples/app-router-playground/app/api/og/route.tsx @@ -66,8 +66,7 @@ export async function GET(req: NextRequest): Promise { } } -function LightSvg(): ReactElement { - return ( +const LIGHT_SVG: ReactElement = ( - ); +); + +function LightSvg(): ReactElement { + return LIGHT_SVG; } function DarkSvg(): ReactElement { @@ -534,7 +536,7 @@ function DarkSvg(): ReactElement { height="88.0875" rx="13.5937" stroke="url(#paint1_radial_1_4)" - stroke-opacity="0.15" + strokeOpacity="0.15" strokeWidth="1.0875" width="88.0875" x="377.456" @@ -544,7 +546,7 @@ function DarkSvg(): ReactElement { height="88.0875" rx="13.5937" stroke="url(#paint2_linear_1_4)" - stroke-opacity="0.5" + strokeOpacity="0.5" strokeWidth="1.0875" width="88.0875" x="377.456" diff --git a/examples/app-router-playground/app/context/context-click-counter.tsx b/examples/app-router-playground/app/context/context-click-counter.tsx index bbb404cdd..36cfab5da 100644 --- a/examples/app-router-playground/app/context/context-click-counter.tsx +++ b/examples/app-router-playground/app/context/context-click-counter.tsx @@ -15,7 +15,7 @@ const ContextClickCounter = () => { animateRerendering={false} >