mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
UI: Improve performance
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-ui': patch
|
||||
---
|
||||
|
||||
Improve performance
|
||||
@@ -102,7 +102,7 @@ import { RootProvider } from 'fumadocs-ui/root-provider';
|
||||
|
||||
### Search Options
|
||||
|
||||
Pass options to the search client (e.g. the [options](/docs/headless/search/orama#options) for Orama).
|
||||
Pass options to the search client, like changing the API endpoint for Orama search server:
|
||||
|
||||
```tsx
|
||||
import { RootProvider } from 'fumadocs-ui/root-provider';
|
||||
|
||||
@@ -5,7 +5,6 @@ import { usePathname } from 'next/navigation';
|
||||
import {
|
||||
type ButtonHTMLAttributes,
|
||||
createContext,
|
||||
Fragment,
|
||||
type HTMLAttributes,
|
||||
type PointerEventHandler,
|
||||
type ReactNode,
|
||||
@@ -414,7 +413,6 @@ export function SidebarPageTree(props: {
|
||||
components?: Partial<SidebarComponents>;
|
||||
}) {
|
||||
const { root } = useTreeContext();
|
||||
const idRef = useRef(0);
|
||||
|
||||
return useMemo(() => {
|
||||
const { Separator, Item, Folder } = props.components ?? {};
|
||||
@@ -464,11 +462,7 @@ export function SidebarPageTree(props: {
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment key={idRef.current++}>
|
||||
{renderSidebarList(root.children, 1)}
|
||||
</Fragment>
|
||||
);
|
||||
return renderSidebarList(root.children, 1);
|
||||
}, [props.components, root.children]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user