Skip to content

Commit

Permalink
fix: the return value format of useFrontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
callqh committed Oct 10, 2022
1 parent f974ca6 commit 6046fca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/theme-default/components/HomeFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getGridClass = (count?: number) => {
};

export function HomeFeature() {
const [frontmatter] = useFrontmatter();
const frontmatter = useFrontmatter();
const features = frontmatter?.features;
const gridClass = getGridClass(features?.length);

Expand Down
2 changes: 1 addition & 1 deletion src/theme-default/components/HomeHero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const DEFAULT_HERO = {
};

export function HomeHero() {
const [frontmatter] = useFrontmatter();
const frontmatter = useFrontmatter();
const hero = frontmatter?.hero || DEFAULT_HERO;
const hasImage = hero.image !== undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/theme-default/logic/useFrontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export const useFrontmatter = () => {
}
}, []);

return [frontmatter];
return frontmatter;
};

0 comments on commit 6046fca

Please sign in to comment.