There was an error while loading. Please reload this page.
2 parents 8374be2 + fe44834 commit 64660deCopy full SHA for 64660de
1 file changed
src/theme/DocSidebarItems/index.js
@@ -0,0 +1,17 @@
1
+import React, {memo} from 'react';
2
+import {DocSidebarItemsExpandedStateProvider} from '@docusaurus/theme-common/internal';
3
+import DocSidebarItem from '@theme/DocSidebarItem';
4
+// TODO this item should probably not receive the "activePath" props
5
+// TODO this triggers whole sidebar re-renders on navigation
6
+function DocSidebarItems({items, ...props}) {
7
+ const itemsFiltered = items.filter((d) => (d.href || '').indexOf('/wip/') === -1)
8
+ return (
9
+ <DocSidebarItemsExpandedStateProvider>
10
+ {itemsFiltered.map((item, index) => (
11
+ <DocSidebarItem key={index} item={item} index={index} {...props} />
12
+ ))}
13
+ </DocSidebarItemsExpandedStateProvider>
14
+ );
15
+}
16
+// Optimize sidebar at each "level"
17
+export default memo(DocSidebarItems);
0 commit comments