For AI agents: the complete documentation index is available at /rspress-russian/llms.txt, the full documentation bundle is available at /rspress-russian/llms-full.txt, and this page is available as Markdown at /rspress-russian/ui/layout-components/root.md.
close

Root

Root — это обёрточный компонент для всего приложения, который охватывает всё содержимое, включая Layout и глобальные UI-компоненты.

Его исходный код выглядит следующим образом:

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

Использование

Используйте его через eject, чтобы обернуть кастомные провайдеры:

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

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

Пропсы

children

  • Тип: ReactNode
  • Обязательный: Да

Дочерние элементы для рендеринга, содержащие всё содержимое приложения.