Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render children as buttonText replacement #7

Merged
merged 2 commits into from
Apr 7, 2017

Conversation

Akh0
Copy link
Contributor

@Akh0 Akh0 commented Apr 4, 2017

Usefull to display a custom button with an icon.

const Tag = link ? 'a' : 'button';
return (
<Tag
name="filestack"
onClick={this.onClickPick}
className={buttonClass}
>
{buttonText}
{!children && buttonText}
Copy link
Contributor

@samuxyz samuxyz Apr 6, 2017

Choose a reason for hiding this comment

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

Since you want to give higher priority to children, what about replacing

{!children && buttonText}
{children}

with

{children || buttonText}

I hope I understood your intentions well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is exactly what I want to do. Actually I would prefer to replace buttonText by children but I don't want to break compatibility.

@samuxyz samuxyz merged commit 7bc9336 into filestack:master Apr 7, 2017
@geoffrey
Copy link

This is great, would it be possible to bump npmjs with this new version ?

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.

3 participants