From 036d0a03ca1c182c71ee997ff8cf088797115b2b Mon Sep 17 00:00:00 2001 From: Erin Replogle Date: Mon, 8 Oct 2018 13:31:25 -0700 Subject: [PATCH] Allow Tabs to detect TabPanels in React (#283) * check props instead of attributes to allow for wrapped React components * remove dist file change --- packages/core/src/components/Tabs/Tabs.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/core/src/components/Tabs/Tabs.jsx b/packages/core/src/components/Tabs/Tabs.jsx index afccb29e71..f5d8065234 100644 --- a/packages/core/src/components/Tabs/Tabs.jsx +++ b/packages/core/src/components/Tabs/Tabs.jsx @@ -46,11 +46,8 @@ function panelTabId(panel) { * @return {Boolean} Is this a TabPanel component? */ function isTabPanel(child) { - // Preact doesn't support child.type, React doesn't support child.attributes - return ( - child && - (child.type === TabPanel || (child.attributes && child.attributes.tab)) - ); + // Preact doesn't support child.type + return child && (child.type === TabPanel || (child.props && child.props.tab)); } /**