Skip to content

Commit

Permalink
docs: fix error of using custom search component
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Feb 11, 2025
1 parent 2f2aed6 commit 688b0d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/document/docs/en/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ export default {
};

// Custom Search Component
const MySearch = () => <div className="my-search">{Search}</div>;
const MySearch = () => (
<div className="my-search">
<Search />
</div>
);
export { MySearch as Search };
// re-export
export * from 'rspress/theme';
Expand Down
6 changes: 5 additions & 1 deletion packages/document/docs/zh/guide/advanced/custom-theme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ export default {
};

// 定制 Search 组件
const MySearch = () => <div className="my-search">{Search}</div>;
const MySearch = () => (
<div className="my-search">
<Search />
</div>
);
export { MySearch as Search };
// 重导出其他部分
export * from 'rspress/theme';
Expand Down

0 comments on commit 688b0d7

Please sign in to comment.