Skip to content

Commit

Permalink
Fix typo and expand getSeoMeta doc example
Browse files Browse the repository at this point in the history
While `matches` is an array, the TS example treats it as an object

The upgrade docs included a more robust example of spreading all the
seo config, adding here as well
  • Loading branch information
= committed Jun 6, 2024
1 parent 4337200 commit 591f1b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hydrogen/src/seo/getSeoMeta.example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ export async function loader({context}: LoaderFunctionArgs) {

export const meta: MetaFunction<typeof loader> = ({data, matches}) => {
// Pass one or more arguments, preserving properties from parent routes
return getSeoMeta((matches as any).data.seo, data!.seo);
return getSeoMeta((matches as any)[0].data.seo, data!.seo);
// Or more simply:
// return getSeoMeta(...matches.map((match) => (match as any).data.seo));
};

0 comments on commit 591f1b4

Please sign in to comment.