Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core, plugin-content-docs): Render NotFoundContent via route if routeBasePath is / #9719

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
now thats prettier
thejcannon committed Jan 9, 2024
commit 25d45e884a3432d772549a3819c18a0f06ec7169
30 changes: 15 additions & 15 deletions packages/docusaurus/src/client/exports/ComponentCreator.tsx
Original file line number Diff line number Diff line change
@@ -45,22 +45,22 @@ export default function ComponentCreator(
}
if (path.endsWith('/*')) {
return Loadable({
loading: Loading,
loader: () => import('@theme/NotFound/Content'),
modules: ['@theme/NotFound/Content'],
webpack: () => [require.resolveWeak('@theme/NotFound/Content')],
render(loaded, props) {
const NotFoundContent = loaded.default;
return (
<RouteContextProvider
// Do we want a better name than native-default?
value={{plugin: {name: 'native', id: 'default'}}}>
<NotFoundContent {...(props as JSX.IntrinsicAttributes)} />
</RouteContextProvider>
);
},
loading: Loading,
loader: () => import('@theme/NotFound/Content'),
modules: ['@theme/NotFound/Content'],
webpack: () => [require.resolveWeak('@theme/NotFound/Content')],
render(loaded, props) {
const NotFoundContent = loaded.default;
return (
<RouteContextProvider
// Do we want a better name than native-default?
value={{plugin: {name: 'native', id: 'default'}}}>
<NotFoundContent {...(props as JSX.IntrinsicAttributes)} />
</RouteContextProvider>
);
},
});
}
}

const chunkNames = routesChunkNames[`${path}-${hash}`]!;
// eslint-disable-next-line @typescript-eslint/no-explicit-any