Skip to content

Commit

Permalink
add useful comment
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 15, 2024
1 parent 5af92b9 commit 428684f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/docusaurus/src/client/theme-fallback/Error/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ function ErrorBoundaryError({error}: {error: Error}): JSX.Element {
return <p style={{whiteSpace: 'pre-wrap'}}>{fullMessage}</p>;
}

// A bit hacky: we need to add an artificial RouteContextProvider here
// The goal is to be able to render the error inside the theme layout
// Without this, our theme classic would crash due to lack of route context
// See also https://github.com/facebook/docusaurus/pull/9852
function ErrorRouteContextProvider({children}: {children: ReactNode}) {
return (
<RouteContextProvider
Expand Down

0 comments on commit 428684f

Please sign in to comment.