Skip to content

Conversation

@gustavoFreireS
Copy link
Contributor

@davidcostadev davidcostadev changed the title close prop on tab and tabBar Close prop on tab and tabBar Aug 16, 2019
{tabList.map((child: any, i) => {
const className = child.tabComponent.props.className;
const activeClassName = child.tabComponent.props.classNameActive;
const closeableTab = child.tabComponent.props.closeable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use defaultProps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just missed it, definitely good to put it, in this case specifically, the props are inside the child component not on the parent itself, I defined the variables here for more readability when using it on the jsx after

>
{child.tabComponent.props.tabHeader || child.tabComponent.props.text}
{props.closeable &&
{ shouldClose &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space

text?: string;
className?: string;
classNameActive?: string;
closeable?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add default props

</Tab>

<Tab text="second tab" className="the-rest">
<Tab text="second tab" >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space

@davidcostadev
Copy link
Contributor

Please rebase this pull request

@davidcostadev
Copy link
Contributor

@gustavoFreireS Could you review this PR again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants