Core: Support other frameworks via FrameworkProvider

This commit is contained in:
Fuma Nama
2025-03-28 21:17:38 +08:00
parent 1ad776b2fe
commit a7cf4fa10f
2 changed files with 16 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-core': minor
---
Support other frameworks via `FrameworkProvider`
+11 -1
View File
@@ -40,7 +40,17 @@ export interface Framework {
Image?: FC<ImageProps>;
}
const FrameworkContext = createContext<Framework>('FrameworkContext');
const notImplemented = () => {
throw new Error(
'You need to wrap your application inside `FrameworkProvider`.',
);
};
const FrameworkContext = createContext<Framework>('FrameworkContext', {
useParams: notImplemented,
useRouter: notImplemented,
usePathname: notImplemented,
});
export function FrameworkProvider({
children,