🚧 Rspress 2.0 document is under development
close

Root eject-only

Warning

This is an eject-only component, designed specifically for wrap/eject, and is not recommended for direct use in MDX files

Root is a wrapper component for the entire application, wrapping all content including the Layout and global UI components.

Its source code is as follows:

Root.tsx
export function Root({ children }: RootProps) {
  return <>{children}</>;
}

Usage

Eject this component to wrap custom providers:

theme/components/Root/index.tsx
import type { RootProps } from '@rspress/core/theme';

export function Root({ children }: RootProps) {
  return <YourProvider>{children}</YourProvider>;
}

Props

children

  • Type: ReactNode
  • Required: Yes

The children elements to render, containing the entire application content.