Skip to content

Commit

Permalink
pass contents as prop instead of children
Browse files Browse the repository at this point in the history
  • Loading branch information
chad1008 committed Dec 12, 2023
1 parent 3e56a32 commit 5fe8b67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/block-editor/src/components/inserter/menu.js
Expand Up @@ -271,9 +271,8 @@ function InserterMenu(
showMedia={ showMedia }
prioritizePatterns={ prioritizePatterns }
onSelect={ handleSetSelectedTab }
>
{ inserterTabsContents }
</InserterTabs>
tabsContents={ inserterTabsContents }
/>
) }
{ ! delayedFilterValue && ! showAsTabs && (
<div className="block-editor-inserter__no-tab-container">
Expand Down
4 changes: 2 additions & 2 deletions packages/block-editor/src/components/inserter/tabs.js
Expand Up @@ -30,11 +30,11 @@ const mediaTab = {
};

function InserterTabs( {
children,
showPatterns = false,
showMedia = false,
onSelect,
prioritizePatterns,
tabsContents,
} ) {
const tabs = useMemo( () => {
const tempTabs = [];
Expand Down Expand Up @@ -67,7 +67,7 @@ function InserterTabs( {
tabId={ tab.name }
focusable={ false }
>
{ children[ tab.name ] }
{ tabsContents[ tab.name ] }
</Tabs.TabPanel>
) ) }
</Tabs>
Expand Down

0 comments on commit 5fe8b67

Please sign in to comment.