File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
examples/app-router/src/app
forced-color-scheme/[colorScheme] Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,13 @@ import type { ColorSchemeType } from "nextjs-themes";
22import { ForceColorScheme } from "nextjs-themes/force-color-scheme" ;
33
44interface PageWithForcedColorSchemeProps {
5- params : { colorScheme : ColorSchemeType } ;
5+ params : Promise < { colorScheme : ColorSchemeType } > ;
66}
77
8- export default function PageWithForcedColorScheme ( {
9- params : { colorScheme } ,
10- } : PageWithForcedColorSchemeProps ) : JSX . Element {
8+ export default async function PageWithForcedColorScheme ( {
9+ params,
10+ } : PageWithForcedColorSchemeProps ) {
11+ const { colorScheme } = await params ;
1112 return (
1213 < >
1314 < ForceColorScheme colorScheme = { colorScheme } />
Original file line number Diff line number Diff line change 11import { ForceTheme } from "nextjs-themes/force-theme" ;
22
33interface PageProps {
4- params : { theme : string } ;
4+ params : Promise < { theme : string } > ;
55}
66
7- export default function PageWithForcedTheme ( { params : { theme } } : PageProps ) : JSX . Element {
7+ export default async function PageWithForcedTheme ( { params } : PageProps ) {
8+ const { theme } = await params ;
89 return (
910 < >
1011 < ForceTheme theme = { theme } />
You can’t perform that action at this time.
0 commit comments