mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Core: Fix failed to update page tree from loader()
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-core': patch
|
||||
---
|
||||
|
||||
Fix failed to update page tree from `loader()`
|
||||
@@ -5,7 +5,7 @@ import type { MDXComponents } from 'mdx/types';
|
||||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
|
||||
import * as icons from 'lucide-react';
|
||||
|
||||
export function getMDXComponents(components?: MDXComponents): MDXComponents {
|
||||
export function getMDXComponents(components?: MDXComponents) {
|
||||
return {
|
||||
...(icons as unknown as MDXComponents),
|
||||
...defaultMdxComponents,
|
||||
@@ -14,5 +14,20 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
|
||||
Accordion,
|
||||
Accordions,
|
||||
...components,
|
||||
};
|
||||
} satisfies MDXComponents;
|
||||
}
|
||||
|
||||
declare module 'mdx/types.js' {
|
||||
// Augment the MDX types to make it understand React.
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace JSX {
|
||||
type Element = React.JSX.Element;
|
||||
type ElementClass = React.JSX.ElementClass;
|
||||
type ElementType = React.JSX.ElementType;
|
||||
type IntrinsicElements = React.JSX.IntrinsicElements;
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
type MDXProvidedComponents = ReturnType<typeof getMDXComponents>;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"content/**/*.mdx",
|
||||
"**/*.mts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
|
||||
@@ -367,7 +367,7 @@ function createOutput(options: LoaderOptions): LoaderOutput<LoaderConfig> {
|
||||
pageTree = v as unknown as Record<string, PageTree.Root>;
|
||||
} else {
|
||||
pageTree = {
|
||||
defaultLanguage: v,
|
||||
[defaultLanguage]: v,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user