Skip to content

Commit 5f14b69

Browse files
committed
update props resolving
1 parent a66f0dd commit 5f14b69

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

app/[[...path]]/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function MDXLayoutRenderer({mdxSource, ...rest}) {
5858
return <MDXLayout components={mdxComponentsWithWrapper} {...rest} />;
5959
}
6060

61-
export default async function Page({params}: {params: {path?: string[]}}) {
61+
export default async function Page(props: {params: Promise<{path?: string[]}>}) {
62+
const params = await props.params;
6263
// get frontmatter of all docs in tree
6364
const rootNode = await getDocsRootNode();
6465

@@ -172,9 +173,9 @@ export default async function Page({params}: {params: {path?: string[]}}) {
172173
}
173174

174175
type MetadataProps = {
175-
params: {
176+
params: Promise<{
176177
path?: string[];
177-
};
178+
}>;
178179
};
179180

180181
// Helper function to clean up canonical tags missing leading or trailing slash
@@ -188,7 +189,8 @@ function formatCanonicalTag(tag: string) {
188189
return tag;
189190
}
190191

191-
export async function generateMetadata({params}: MetadataProps): Promise<Metadata> {
192+
export async function generateMetadata(props: MetadataProps): Promise<Metadata> {
193+
const params = await props.params;
192194
const domain = isDeveloperDocs
193195
? 'https://develop.sentry.dev'
194196
: 'https://docs.sentry.io';

app/platform-redirect/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ export const metadata: Metadata = {
1515
'The page you are looking for is customized for each platform. Select your platform below and we’ll direct you to the most specific documentation on it.',
1616
};
1717

18-
export default async function Page({
19-
searchParams: {next = '', platform},
20-
}: {
21-
searchParams: {[key: string]: string | string[] | undefined};
18+
export default async function Page(props: {
19+
searchParams: Promise<{[key: string]: string | string[] | undefined}>;
2220
}) {
21+
const searchParams = await props.searchParams;
22+
23+
let next = searchParams.next || '';
24+
const platform = searchParams.platform;
25+
2326
if (Array.isArray(next)) {
2427
next = next[0];
2528
}

0 commit comments

Comments
 (0)