mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Core: Support other frameworks via FrameworkProvider
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-core': minor
|
||||
---
|
||||
|
||||
Support other frameworks via `FrameworkProvider`
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user