Skip to content

Commit

Permalink
Allow Tabs to detect TabPanels in React (#283)
Browse files Browse the repository at this point in the history
* check props instead of attributes to allow for wrapped React components

* remove dist file change
  • Loading branch information
erinrep authored Oct 8, 2018
1 parent 63038e0 commit 036d0a0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/components/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down

0 comments on commit 036d0a0

Please sign in to comment.