Skip to content

Commit 62da9fc

Browse files
Tab: Content - Return undefined instead of empty fragment + update comment
1 parent a44546d commit 62da9fc

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

assets/build/example.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/src/components/base/tab/Tab.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { useState, useEffect } from 'react'
22
import Button from '../button/Button'
33

44
/**
5-
* No logic/state, just to share the CSS/classes
6-
*
75
* <Container>
86
* <Header>
97
* <Title>Content 1</Title>
108
* <Title>Content 2</Title>
119
* <Header>
12-
* <Content>
10+
* <Content isActive={ true }>
1311
* <Row>
1412
* <RowTitle>Content 1</RowTitle>
1513
* </Row>
@@ -21,6 +19,9 @@ import Button from '../button/Button'
2119
* </Row>
2220
* // ...
2321
* <Content>
22+
* <Content isActive={ false }>
23+
* // ...
24+
* <Content>
2425
* <Tabs>
2526
*/
2627

@@ -61,7 +62,7 @@ const Content = props => {
6162
if ( props.isActive !== isActive ) setIsActive( props.isActive )
6263
}, [ props.isActive ])
6364

64-
if ( ! isActive ) return <></>;
65+
if ( ! isActive ) return;
6566

6667
return(
6768
<div className={ 'tf-tab-content ' + (props.className ?? '') }>

0 commit comments

Comments
 (0)