Skip to content

Commit

Permalink
Add AsyncModeProvider to speed up the persistent list view
Browse files Browse the repository at this point in the history
  • Loading branch information
Copons committed Mar 18, 2021
1 parent 44df848 commit 68ebe35
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useInstanceId,
useMergeRefs,
} from '@wordpress/compose';
import { useDispatch, useSelect } from '@wordpress/data';
import { AsyncModeProvider, useDispatch, useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { closeSmall } from '@wordpress/icons';
import { ESCAPE } from '@wordpress/keycodes';
Expand Down Expand Up @@ -71,13 +71,15 @@ export default function ListViewSidebar() {
className="edit-site-editor__list-view-panel-content"
ref={ useMergeRefs( [ focusReturnRef, focusOnMountRef ] ) }
>
<BlockNavigationTree
blocks={ clientIdsTree }
selectBlock={ selectEditorBlock }
selectedBlockClientId={ selectedBlockClientId }
showNestedBlocks
__experimentalPersistentListViewFeatures
/>
<AsyncModeProvider value="true">
<BlockNavigationTree
blocks={ clientIdsTree }
selectBlock={ selectEditorBlock }
selectedBlockClientId={ selectedBlockClientId }
showNestedBlocks
__experimentalPersistentListViewFeatures
/>
</AsyncModeProvider>
</div>
</div>
);
Expand Down

0 comments on commit 68ebe35

Please sign in to comment.