perf: Navigation of shared trees feels slow (#3171)

* perf: Navigation of shared trees feels slow

* remove redundant call to setActiveDocument

Co-authored-by: Nan Yu <thenanyu@gmail.com>
This commit is contained in:
Tom Moor
2022-03-01 21:51:51 -08:00
committed by GitHub
parent 3ac125d560
commit 4468d29740
4 changed files with 67 additions and 11 deletions

View File

@@ -14,7 +14,7 @@ type Props = {
};
function SharedSidebar({ rootNode, shareId }: Props) {
const { documents } = useStores();
const { ui, documents } = useStores();
return (
<Sidebar>
@@ -25,6 +25,7 @@ function SharedSidebar({ rootNode, shareId }: Props) {
shareId={shareId}
depth={1}
node={rootNode}
activeDocumentId={ui.activeDocumentId}
activeDocument={documents.active}
/>
</Section>