diff --git a/packages/core/src/components/tabs/tabPanel.tsx b/packages/core/src/components/tabs/tabPanel.tsx index 7e6f6fab2c..0e43b354f7 100644 --- a/packages/core/src/components/tabs/tabPanel.tsx +++ b/packages/core/src/components/tabs/tabPanel.tsx @@ -20,9 +20,13 @@ import * as React from "react"; import { AbstractPureComponent, Classes, Utils } from "../../common"; import { type TabProps } from "./tab"; +import type { TabsProps } from "./tabs"; import { generateTabIds, type TabTitleProps } from "./tabTitle"; -export interface TabPanelProps extends Pick, Pick { +export interface TabPanelProps + extends Pick, + Pick, + Pick { /** * Used for setting `aria-hidden` prop. */ @@ -34,9 +38,9 @@ export interface TabPanelProps extends Pick { public render() { - const { className, id, parentId, panel, isHidden } = this.props; + const { className, id, parentId, panel, isHidden, renderActiveTabPanelOnly } = this.props; - if (panel === undefined) { + if (panel === undefined || (renderActiveTabPanelOnly && isHidden)) { return undefined; }