diff --git a/packages/docusaurus-module-type-aliases/src/index.d.ts b/packages/docusaurus-module-type-aliases/src/index.d.ts index 3a900c907d77..243c06c9c4ed 100644 --- a/packages/docusaurus-module-type-aliases/src/index.d.ts +++ b/packages/docusaurus-module-type-aliases/src/index.d.ts @@ -80,9 +80,9 @@ declare module '@theme/Error' { import type {ComponentProps} from 'react'; import type ErrorBoundary from '@docusaurus/ErrorBoundary'; - type ErrorProps = ComponentProps< + type ErrorProps = Parameters< NonNullable['fallback']> - >; + >[0]; export interface Props extends ErrorProps {} export default function Error(props: Props): JSX.Element; @@ -125,13 +125,13 @@ declare module '@docusaurus/constants' { } declare module '@docusaurus/ErrorBoundary' { - import type {ReactNode, ComponentType} from 'react'; + import type {ReactNode} from 'react'; export interface Props { - readonly fallback?: ComponentType<{ + readonly fallback?: (props: { readonly error: Error; readonly tryAgain: () => void; - }>; + }) => JSX.Element; readonly children: ReactNode; } export default function ErrorBoundary(props: Props): JSX.Element; diff --git a/packages/docusaurus-theme-classic/src/theme/Layout/index.tsx b/packages/docusaurus-theme-classic/src/theme/Layout/index.tsx index c5503edcaaa2..f6e749c9833d 100644 --- a/packages/docusaurus-theme-classic/src/theme/Layout/index.tsx +++ b/packages/docusaurus-theme-classic/src/theme/Layout/index.tsx @@ -45,7 +45,9 @@ export default function Layout(props: Props): JSX.Element {
- {children} + }> + {children} +
{!noFooter &&