Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

markH5/my_search_doc_err

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to reproduce

web-infra-dev/rspress#1818

Setup 1

Install the dependencies:

pnpm create rspress@latest
pnpm i react
pnpm i react-dom

pnpm i typescript -D
pnpm i @types/react -D
pnpm i @types/react-dom -D

Setup 2

copy code from doc https://rspress.dev/guide/advanced/custom-theme#3-custom-home-page-and-404-page

// theme/index.tsx
import Theme, { Search } from 'rspress/theme';

// Use slot
const Layout = () => <Theme.Layout beforeNavTitle={<div>some content</div>} />;
// Custom Home Page
const HomeLayout = () => <div>Home</div>;
// Custom 404 page
const NotFoundLayout = () => <div>404</div>;

export default {
  ...Theme,
  Layout,
  HomeLayout,
  NotFoundLayout,
};

// Custom Search Component
const MySearch = () => <div className="my-search">{Search}</div>;
export { MySearch as Search };
// re-export
export * from 'rspress/theme';

type error

hover at {Search} , get type error

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published